mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
corrected DynChild
to now mount children on SSR
This commit is contained in:
parent
70ae60d4d5
commit
61e206c227
2 changed files with 14 additions and 1 deletions
|
@ -162,12 +162,25 @@ where
|
|||
}
|
||||
|
||||
#[cfg(all(target_arch = "wasm32", feature = "web"))]
|
||||
mount_child(MountKind::Before(&closing), &new_child);
|
||||
{
|
||||
if cfg!(feature = "hydrate") && !HydrationCtx::is_hydrating() {
|
||||
mount_child(MountKind::Before(&closing), &new_child);
|
||||
} else {
|
||||
mount_child(MountKind::Before(&closing), &new_child);
|
||||
}
|
||||
}
|
||||
|
||||
**child.borrow_mut() = Some(new_child);
|
||||
}
|
||||
});
|
||||
|
||||
#[cfg(not(all(target_arch = "wasm32", feature = "web")))]
|
||||
{
|
||||
let new_child = child_fn().into_view(cx);
|
||||
|
||||
**child.borrow_mut() = Some(new_child);
|
||||
}
|
||||
|
||||
View::CoreComponent(crate::CoreComponent::DynChild(component))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue