Created
June 15, 2023 15:31
-
-
Save fagundescodes/175a4b0f0d989913ba6a6611c869903e to your computer and use it in GitHub Desktop.
dioxus_test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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