chore: get create working and simplify dynamic nodes

This commit is contained in:
Jonathan Kelley committed 2022-11-30 11:24:13 -05:00
1 parent 16a521a601
commit 3c19def550
16 files changed
+168 -173

No files matched your search

+1 -1
View File
@@ -47,5 +47,5 @@ pub fn Redirect<'a>(cx: Scope<'a, RedirectProps<'a>>) -> Element {
router.replace_route(cx.props.to, None, None);
}
None
cx.render(rsx!(()))
}
+3 -2
View File
@@ -29,7 +29,8 @@ pub struct RouteProps<'a> {
pub fn Route<'a>(cx: Scope<'a, RouteProps<'a>>) -> Element {
let router_root = cx
.use_hook(|| cx.consume_context::<Arc<RouterCore>>())
.as_ref()?;
.as_ref()
.unwrap();
cx.use_hook(|| {
// create a bigger, better, longer route if one above us exists
@@ -55,6 +56,6 @@ pub fn Route<'a>(cx: Scope<'a, RouteProps<'a>>) -> Element {
cx.render(rsx!(&cx.props.children))
} else {
log::trace!("Route should *not* render: {:?}", cx.scope_id());
None
cx.render(rsx!(()))
}
}