FIxes for Suspense/Hydration

This commit is contained in:
Greg Johnston 2022-12-17 08:46:09 -05:00
parent 9c6aaed0a8
commit df41e4dbc2
3 changed files with 5 additions and 1 deletions

View File

@ -94,6 +94,7 @@ where
use leptos_dom::DynChild;
let cached_id = HydrationCtx::peak();
let _space_for_inner = HydrationCtx::id();
DynChild::new(move || {
if context.ready() {

View File

@ -110,9 +110,11 @@ where
let prev_child = RefCell::new(None);
let cached_id = HydrationCtx::peak();
let _space_for_inner = HydrationCtx::id();
DynChild::new(move || {
if context.ready() {
leptos_dom::warn!("<Transition/> ready and continuing from {}", cached_id);
HydrationCtx::continue_from(cached_id);
let current_child = child(cx).into_view(cx);

View File

@ -29,7 +29,8 @@ impl HydrationCtx {
unsafe { ID }
}
pub(crate) fn id() -> usize {
/// Increments the current hydration `id` and returns it
pub fn id() -> usize {
unsafe {
let id = ID;