mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-01-23 18:15:05 +00:00
16 lines
384 B
Rust
16 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" }
|
|
))
|
|
}
|