You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading a resource in a hydrated context, usually via an effect, you get a hydration warning.
Warning text
At src/app.rs:48:39, you are reading a resource in hydrate mode outside a or . This can cause hydration mismatch errors and loses out on a significant performance optimization. To fix this issue, you can either:
Wrap the place where you read the resource in a or component, or
Switch to using create_local_resource(), which will wait to load the resource until the app is hydrated on the client side. (This will have worse performance in most cases.) leptos-fullstack-test.js:875:9
Leptos Dependencies
Please copy and paste the Leptos dependencies and features from your Cargo.toml.
For example:
leptos = { version = "0.6", features = ["nightly"] }
leptos_axum = { version = "0.6", optional = true }
leptos_meta = { version = "0.6", features = ["nightly"] }
leptos_router = { version = "0.6", features = ["nightly"] }
To Reproduce
Steps to reproduce the behavior:
Create a server fn:
The warning here will just need to be updated so that it is disabled in user effects -- you are correct that there is no actual issue, it's a false positive.
This is a big problem for me too. I get a lot of these messages on app start, and I am very nervous that in some cases it could turn out to be an issue in my code (I'm basically trying to carefully only use the with and get after the resource has already been loaded, but there's no guarantee that I don't accidentally put it in the wrong place).
Is there a workaround for this?
Other than writing provide_context(SuspenseContext::new()); // TODO: Remove?
Describe the bug
When reading a resource in a hydrated context, usually via an effect, you get a hydration warning.
Warning text
At src/app.rs:48:39, you are reading a resource in
hydrate
mode outside a or . This can cause hydration mismatch errors and loses out on a significant performance optimization. To fix this issue, you can either:Leptos Dependencies
Please copy and paste the Leptos dependencies and features from your
Cargo.toml
.For example:
To Reproduce
Steps to reproduce the behavior:
Create a server fn:
Put this in a component:
The Warning appears on hydration
Expected behavior
No warning should appear
The text was updated successfully, but these errors were encountered: