Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

props macro isn't recognizing Option inside ReadOnlySignal to make it optional in the builder #2648

Closed
rogusdev opened this issue Jul 19, 2024 · 0 comments · Fixed by #2761
Closed
Assignees
Labels
bug Something isn't working core relating to the core implementation of the virtualdom tweak Small changes to improve experience
Milestone

Comments

@rogusdev
Copy link
Contributor

rogusdev commented Jul 19, 2024

Problem

https://discord.com/channels/899851952891002890/1228376558188761169/1263709761594200084

In a Route enum:

    #[route("/noblog", Blog)]
    BlogNone {},

Works with this component:

#[component]
fn Blog(id: Option<i32>) -> Element {
    rsx! {
        Link { to: Route::Home {}, "Go to counter" }
        if id.is_some() {
            "Blog post {id.unwrap()}"
        } else {
            "Blog post NONE"
        }
    }
}

But this fails to compile if the component takes an ReadOnlySignal<Option<i32>> and requires some workarounds.

@ealmloff said the issue is the title of this issue

Environment:

  • Dioxus version: main
  • App platform: web
@ealmloff ealmloff added core relating to the core implementation of the virtualdom tweak Small changes to improve experience labels Jul 19, 2024
@jkelleyrtp jkelleyrtp added this to the 0.6.0 milestone Jul 25, 2024
@jkelleyrtp jkelleyrtp added the bug Something isn't working label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core relating to the core implementation of the virtualdom tweak Small changes to improve experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants