mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
Fix Outlet
This commit is contained in:
parent
02a7af2c1e
commit
498b5345d5
1 changed files with 6 additions and 9 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue