mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-01-08 02:38:51 +00:00
17 lines
384 B
Rust
17 lines
384 B
Rust
|
use dioxus::prelude::*;
|
||
|
use dioxus_core as dioxus;
|
||
|
use dioxus_core_macro::*;
|
||
|
use dioxus_hooks::use_state;
|
||
|
use dioxus_html as dioxus_elements;
|
||
|
|
||
|
fn main() {}
|
||
|
|
||
|
fn App(cx: Scope<()>) -> Element {
|
||
|
let color = use_state(&cx, || "white");
|
||
|
|
||
|
cx.render(rsx!(
|
||
|
div { onclick: move |_| color.set("red"), "red" }
|
||
|
div { onclick: move |_| color.set("blue"), "blue" }
|
||
|
))
|
||
|
}
|