fix: allow Suspense to remount before rebuilding (closes #2721)

This commit is contained in:
Greg Johnston 2024-07-28 09:11:04 -04:00
parent a6a65ba562
commit 29b0dca1d8

View file

@ -151,6 +151,10 @@ where
async move {
let value = fut.await;
drop(id);
// waiting a tick here allows Suspense to remount if necessary, which prevents some
// edge cases in which a rebuild can't happen while unmounted because the DOM node
// has no parent
any_spawner::Executor::tick().await;
Some(value).rebuild(&mut *state.borrow_mut());
}
});