Replies: 1 comment 1 reply
-
If I understand the question, you are asking why the example can't just be this? fn app() -> Element {
let mut count = 0;
rsx! {
h1 { "High-Five counter: {count}" }
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
}
} There are two main reasons:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In your example:
Was wondering can the data type for
count
be inu8
instead of using the function:use_signal(|| 0);
which I assume would assign the variable with a non-primative data type?Beta Was this translation helpful? Give feedback.
All reactions