wip: add router

This commit is contained in:
Jonathan Kelley committed 2021-11-03 00:35:56 -04:00
1 parent 9874f342e2
commit d298b626d3
17 files changed
+617 -20

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
use dioxus::prelude::*;
fn main() {}
enum Routes {
Home,
Blog,
}
static App: FC<()> = |(cx, props)| {
let route = use_router::<Routes>(cx);
let content = match route {
Routes::Home => rsx!(Home {}),
Routes::Blog => rsx!(Blog {}),
};
cx.render(rsx! {
{content}
})
};
fn use_router<P>(cx: Context) -> &P {
todo!()
}
static Home: FC<()> = |(cx, props)| todo!();
static Blog: FC<()> = |(cx, props)| todo!();