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

Renaming value doesn't change in rsx macro #2422

Closed
mrgzi opened this issue May 16, 2024 · 1 comment · Fixed by #2421
Closed

Renaming value doesn't change in rsx macro #2422

mrgzi opened this issue May 16, 2024 · 1 comment · Fixed by #2421
Labels
rsx Related to rsx or the dioxus-rsx crate tweak Small changes to improve experience

Comments

@mrgzi
Copy link

mrgzi commented May 16, 2024

When we rename the value, it doesn't change the value if its inside a string. but it changes in rust code.

pub fn component() -> Element {
    let mut username = use_signal(|| "".to_string());

    rsx! {
        input {
            r#type: "text",
            value: "{username}",
        }
    }
}
@ealmloff ealmloff added tweak Small changes to improve experience rsx Related to rsx or the dioxus-rsx crate labels May 17, 2024
@ealmloff
Copy link
Member

I think this is caused by assigning the wrong span to variables inside rsx. We parse the rsx macro using syn which is really meant to parse rust-like things, not raw text which makes things like the format macro in dioxus difficult

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rsx Related to rsx or the dioxus-rsx crate tweak Small changes to improve experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants