corrected DynChild to now mount children on SSR

This commit is contained in:
Jose Quesada 2022-12-08 09:19:00 -06:00
parent 70ae60d4d5
commit 61e206c227
2 changed files with 14 additions and 1 deletions

View file

@ -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))
}
}