fix: really big bug around hooks

This commit is contained in:
Jonathan Kelley committed 2021-11-29 11:10:40 -05:00
1 parent 36d89beb34
commit 52c7154897
22 files changed
+413 -342

No files matched your search

+3 -1
View File
@@ -11,14 +11,16 @@ use dioxus_hooks::*;
use dioxus_html as dioxus_elements;
fn main() {
simple_logger::init().unwrap();
dioxus_desktop::launch(App, |c| c);
}
static App: FC<()> = |cx, props| {
let mut count = use_state(cx, || 0);
log::debug!("count is {:?}", count);
cx.push_task(|| async move {
tokio::time::sleep(Duration::from_millis(100)).await;
tokio::time::sleep(Duration::from_millis(1000)).await;
count += 1;
});