Make cargo check --all --examples work!

This commit is contained in:
Jonathan Kelley committed 2024-01-19 14:19:49 -08:00
1 parent 08475af221
commit 83bce6ce97
40 files changed
+295 -399

No files matched your search

+8 -11
View File
@@ -2,25 +2,22 @@ use dioxus::prelude::*;
use dioxus_signals::*;
fn main() {
tracing_subscriber::fmt::init();
dioxus_desktop::launch(App);
// dioxus_desktop::launch(App);
}
#[component]
fn App(cx: Scope) -> Element {
let mut signal = use_signal_sync(cx, || 0);
cx.use_hook(|| {
fn App() -> Element {
let mut signal = use_signal_sync(|| 0);
use_hook(|| {
std::thread::spawn(move || loop {
std::thread::sleep(std::time::Duration::from_secs(1));
signal += 1;
})
});
});
render! {
button {
onclick: move |_| signal += 1,
"Increase"
}
rsx! {
button { onclick: move |_| signal += 1, "Increase" }
"{signal}"
}
}