-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hydration broken with React v16.10.0 #32
Comments
This change in React was not technically a breaking change since it changed something that wasn't part of the public API. Because this changed behaviour had such high impact however, for example on Next.js-apps, this was fixed in #16943 and released as React v16.10.1. This means Lightyear should keep working without workarounds for now. Note that this isn't the final semantics that React will use, so this problem could/will be reintroduced in some form at some point. I will verify that everything works as expected with v16.10.1 and if so add some documentation about React v16.10.0 being broken with Lightyear and then make a release tomorrow. |
Additional info:
|
I've verified two things today:
Long story short, React doesn't officially support hydrating I've made a v16.10.0 release of Lightyear and I'm closing this issue, for now. |
After preparing a merge and release for v16.10.0 I discovered a problem during testing, namely that hydration is broken when using Lightyear.
React v16.10.0 has ongoing work for Partial hydration which v16.9.0 did not have. From what I can tell the behaviour when React encounters a
<Suspense>
boundary during hydration has changed.Error is:
"Expected to have a hydrated suspense instance."
which comes fromprepareToHydrateHostSuspenseInstance
.Sadly, I don't think this can be fixed properly in Lightyear itself (but I'm 100% sure yet), in that case I see two possible ways forward (neither of which are verified to work):
react-dom
together with Lightyear, with theenableSuspenseServerRenderer
feature flag turned on (and/or some other tweak)<Suspense>
on the server, outputting a fragment on the client. This could be changed back to a<Suspense>
-component after hydration.The text was updated successfully, but these errors were encountered: