Feat: about to consolidate context and scope

This commit is contained in:
Jonathan Kelley committed 2021-05-17 17:59:10 -04:00
1 parent 3de54d0b52
commit 4c8130c4e4
5 files changed
+136 -9

No files matched your search

+32 -1
View File
@@ -8,4 +8,35 @@
use dioxus::prelude::*;
fn main() {}
fn main() {
diouxs_webview::launch(App).run().await
}
fn App(ctx: Context, props: &()) -> DomTree {
let router = use_router(&ctx, |router| {
//
router.get("/dogs/:dogId/").render(|ctx, request| {
rsx! {
div {
}
}
});
router.get("/cats/:catId/").render(|ctx, request| {
rsx! {
div {
}
}
});
});
ctx.render(rsx! {
div {
a { href="/dogs/"}
a { href="/cats/"}
{router.render()}
}
})
}