Fix router state after client side navigation (#4383)
* Fix router state after client side navigation * add client side navigation to the fullstack routing spec * fix playwright test
This commit is contained in:
1 parent
ddc94cf44c
commit
b252528722
4 files changed
+53
-5
No files matched your search
@@ -144,6 +144,19 @@ impl<T> SerializeContextEntry<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Check if the client is currently rendering a component for hydration. Always returns true on the server.
|
||||
pub fn is_hydrating() -> bool {
|
||||
#[cfg(feature = "web")]
|
||||
{
|
||||
// On the client, we can check if the context is set
|
||||
CONTEXT.with(|context| context.borrow().is_some())
|
||||
}
|
||||
#[cfg(not(feature = "web"))]
|
||||
{
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
/// Get or insert the current serialize context. On the client, the hydration context this returns
|
||||
/// will always return `TakeDataError::DataNotAvailable` if hydration of the current chunk is finished.
|
||||
pub fn serialize_context() -> HydrationContext {
|
||||
|
||||
Reference in new issue
Block a user