Feat: event loop

This commit is contained in:
Jonathan Kelley committed 2021-02-12 16:11:33 -05:00
1 parent 8295ac4b3d
commit ea2aa4b0c9
39 files changed
+495 -287

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
use dioxus_core::prelude::*;
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!")
});
}
static Example: FC<()> = |ctx, props| {
ctx.view(html! {
<div>
"Hello world!"
</div>
})
};