fix layouts in child routes

This commit is contained in:
Evan Almloff committed 2023-07-13 19:56:30 -07:00
1 parent 128f3e4425
commit 5f37dcc2ac
2 files changed
+12 -2

No files matched your search

+10
View File
@@ -119,6 +119,8 @@ pub fn GenericRouter<R: Routable + Clone>(cx: Scope<GenericRouterProps<R>>) -> E
where
<R as FromStr>::Err: std::fmt::Display,
{
use crate::prelude::outlet::OutletContext;
use_context_provider(cx, || {
GenericRouterContext::new(
(cx.props
@@ -129,6 +131,10 @@ where
cx.schedule_update_any(),
)
});
use_context_provider(cx, || OutletContext::<R> {
current_level: 0,
_marker: std::marker::PhantomData,
});
render! {
GenericOutlet::<R> {}
@@ -152,6 +158,10 @@ where
cx.schedule_update_any(),
)
});
use_context_provider(cx, || OutletContext::<R> {
current_level: 0,
_marker: std::marker::PhantomData,
});
render! {
GenericOutlet::<R> {}