mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
This commit is contained in:
parent
fd133dd79a
commit
c4b1176a6a
2 changed files with 17 additions and 2 deletions
|
@ -120,6 +120,9 @@ where
|
|||
);
|
||||
let params_memo = ArcMemo::from(params.clone());
|
||||
|
||||
// release URL lock
|
||||
drop(current_url);
|
||||
|
||||
match new_match {
|
||||
None => Rc::new(RefCell::new(FlatRoutesViewState {
|
||||
view: EitherOf3::B(fallback()).build(),
|
||||
|
@ -381,6 +384,10 @@ where
|
|||
.unwrap_or_default(),
|
||||
);
|
||||
let params_memo = ArcMemo::from(params.clone());
|
||||
|
||||
// release URL lock
|
||||
drop(current_url);
|
||||
|
||||
let view = match new_match {
|
||||
None => Either::Left((self.fallback)()),
|
||||
Some(new_match) => {
|
||||
|
@ -543,6 +550,9 @@ where
|
|||
);
|
||||
let params_memo = ArcMemo::from(params.clone());
|
||||
|
||||
// release URL lock
|
||||
drop(current_url);
|
||||
|
||||
match new_match {
|
||||
None => Rc::new(RefCell::new(FlatRoutesViewState {
|
||||
view: EitherOf3::B(fallback())
|
||||
|
|
|
@ -93,6 +93,7 @@ where
|
|||
let mut loaders = Vec::new();
|
||||
let mut outlets = Vec::new();
|
||||
let url = current_url.read_untracked();
|
||||
let path = url.path().to_string();
|
||||
|
||||
// match the route
|
||||
let new_match = routes.match_route(url.path());
|
||||
|
@ -110,6 +111,7 @@ where
|
|||
&mut outlets,
|
||||
&outer_owner,
|
||||
);
|
||||
drop(url);
|
||||
outer_owner.with(|| {
|
||||
EitherOf3::C(
|
||||
Outlet(OutletProps::builder().build()).into_any(),
|
||||
|
@ -131,7 +133,7 @@ where
|
|||
});
|
||||
|
||||
NestedRouteViewState {
|
||||
path: url.path().to_string(),
|
||||
path,
|
||||
current_url,
|
||||
outlets,
|
||||
view,
|
||||
|
@ -411,6 +413,7 @@ where
|
|||
let mut loaders = Vec::new();
|
||||
let mut outlets = Vec::new();
|
||||
let url = current_url.read_untracked();
|
||||
let path = url.path().to_string();
|
||||
|
||||
// match the route
|
||||
let new_match = routes.match_route(url.path());
|
||||
|
@ -427,6 +430,8 @@ where
|
|||
&mut outlets,
|
||||
&outer_owner,
|
||||
);
|
||||
drop(url);
|
||||
|
||||
// TODO support for lazy hydration
|
||||
join_all(mem::take(&mut loaders))
|
||||
.now_or_never()
|
||||
|
@ -442,7 +447,7 @@ where
|
|||
));
|
||||
|
||||
NestedRouteViewState {
|
||||
path: url.path().to_string(),
|
||||
path,
|
||||
current_url,
|
||||
outlets,
|
||||
view,
|
||||
|
|
Loading…
Reference in a new issue