mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
fix: setting set_pending
now that <Transition/>
body doesn't re-render (#1193)
This commit is contained in:
parent
23594a43ea
commit
77439b5db5
1 changed files with 10 additions and 7 deletions
|
@ -1,6 +1,9 @@
|
|||
use leptos_dom::{Fragment, IntoView, View};
|
||||
use leptos_macro::component;
|
||||
use leptos_reactive::{use_context, Scope, SignalSetter, SuspenseContext};
|
||||
use leptos_reactive::{
|
||||
create_isomorphic_effect, use_context, Scope, SignalGet, SignalSetter,
|
||||
SuspenseContext,
|
||||
};
|
||||
use std::{
|
||||
cell::{Cell, RefCell},
|
||||
rc::Rc,
|
||||
|
@ -97,9 +100,6 @@ where
|
|||
is_first_run(&first_run, &suspense_context);
|
||||
first_run.set(is_first_run);
|
||||
|
||||
if let Some(set_pending) = &set_pending {
|
||||
set_pending.set(true);
|
||||
}
|
||||
if let Some(prev_children) = &*prev_child.borrow() {
|
||||
if is_first_run {
|
||||
fallback().into_view(cx)
|
||||
|
@ -132,9 +132,12 @@ where
|
|||
}
|
||||
child_runs.set(child_runs.get() + 1);
|
||||
|
||||
if let Some(set_pending) = &set_pending {
|
||||
set_pending.set(false);
|
||||
}
|
||||
let pending = suspense_context.pending_resources;
|
||||
create_isomorphic_effect(cx, move |_| {
|
||||
if let Some(set_pending) = set_pending {
|
||||
set_pending.set(pending.get() > 0)
|
||||
}
|
||||
});
|
||||
frag
|
||||
}))
|
||||
.build(),
|
||||
|
|
Loading…
Reference in a new issue