Fix Outlet

This commit is contained in:
Greg Johnston 2022-11-24 08:51:53 -05:00
parent 02a7af2c1e
commit 498b5345d5

View file

@ -6,14 +6,11 @@ use leptos::*;
#[component]
pub fn Outlet(cx: Scope) -> Child {
let route = use_route(cx);
(create_memo(cx, move |prev| {
route
.child()
.map(|child| {
provide_context(child.cx(), child.clone());
child.outlet().into_child(cx)
})
.unwrap_or(Child::Null)
}))
(move || {
route.child().map(|child| {
provide_context(child.cx(), child.clone());
child.outlet()
})
})
.into_child(cx)
}