Feat: wire up rebuild

This commit is contained in:
Jonathan Kelley committed 2021-02-24 03:51:26 -05:00
1 parent 4d01455729
commit 06ae4fc178
11 files changed
+210 -170

No files matched your search

+2 -7
View File
@@ -4,15 +4,10 @@ use dioxus_web::WebsysRenderer;
fn main() {
// todo: set this up so the websys render can spawn itself rather than having to wrap it
// almost like bundling an executor with the wasm version
wasm_bindgen_futures::spawn_local(async {
WebsysRenderer::new(Example)
.run()
.await
.expect("Dioxus Failed! This should *not* happen!")
});
wasm_bindgen_futures::spawn_local(WebsysRenderer::start(Example));
}
static Example: FC<()> = |ctx, props| {
static Example: FC<()> = |ctx, _props| {
ctx.view(html! {
<div>
"Hello world!"
+2 -2
View File
@@ -9,7 +9,7 @@ fn main() {
wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
console_error_panic_hook::set_once();
WebsysRenderer::new(|ctx, _| {
wasm_bindgen_futures::spawn_local(WebsysRenderer::start(|ctx, _| {
ctx.view(html! {
<div>
<div class="flex items-center justify-center flex-col">
@@ -43,5 +43,5 @@ fn main() {
</div>
</div>
})
});
}));
}