Giter VIP home page Giter VIP logo

Comments (7)

marc2332 avatar marc2332 commented on July 18, 2024 1

It's actually not a bug, to display text you have to use the label or paragraph elements. That said, I should add a friendlier error heh

from freya.

marc2332 avatar marc2332 commented on July 18, 2024 1

Just opened #589 so it fails silently

For a better DX I think some kind of error reporting or log reporting would be nice -> #454

from freya.

ZeroX-DG avatar ZeroX-DG commented on July 18, 2024

Oh my bad. It doesn't matter what the position is. It'll crash if the child is a text. This works just fine:

#![cfg_attr(
    all(not(debug_assertions), target_os = "windows"),
    windows_subsystem = "windows"
)]

use freya::prelude::*;

fn main() {
    launch(app);
}

fn app() -> Element {
    rsx!(
        rect {
            position: "absolute",
            position_top: "10",
            position_left: "10",
            label { "Just some text" }
        }
    )
}

from freya.

marc2332 avatar marc2332 commented on July 18, 2024

Or maybe fail silently? What do you think it's better?

from freya.

marc2332 avatar marc2332 commented on July 18, 2024

I think I will just fail silently, will improve it asap, it's easy

from freya.

ZeroX-DG avatar ZeroX-DG commented on July 18, 2024

Nice! Yeah it's definitely better to fail silently. In JS you'd have a warning log in the console that warn you about the invalid nested element.

Another cool option is to catch these errors at compile time but that'd be pretty difficult (I imagine) 😄

from freya.

marc2332 avatar marc2332 commented on July 18, 2024

Another cool option is to catch these errors at compile time but that'd be pretty difficult (I imagine) 😄

I would love that, but Dioxus doesn't support it :(

from freya.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.