Skip to content

Instantly share code, notes, and snippets.

@fagundescodes
Created June 15, 2023 15:31
Show Gist options
  • Select an option

  • Save fagundescodes/175a4b0f0d989913ba6a6611c869903e to your computer and use it in GitHub Desktop.

Select an option

Save fagundescodes/175a4b0f0d989913ba6a6611c869903e to your computer and use it in GitHub Desktop.
dioxus_test
use dioxus::prelude::*;
fn main() {
dioxus_desktop::launch(app);
}
fn app(cx: Scope) -> Element {
println!("rendered");
let val = cx.use_hook(|| 0);
render! {
h1 {
onclick: move |_| {
println!("Clicked");
cx.needs_update();
},
"Hello World! {val}"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment