-
Notifications
You must be signed in to change notification settings - Fork 12
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
Investigate hydration with Suspense and undefined fallback #46
Comments
That is indeed what Can you provide more info so we can tweak that function? Or do you have better recommendations on how to do that? |
So the problem is on the client side, not on the server.
Wrapped content is expected to be recreated - https://github.com/sebmarkbage/react/blob/185700696ebbe737c99bd6c4b678d5f2a923bd29/packages/react-dom/src/__tests__/ReactServerRenderingHydration-test.js#L668-L682 The problem was discovered not with |
Ah, I see what you mean. I actually didn't know about the |
Not sure how you render Suspense boundary after hydration as long as that should lead to local tree remount. And could not find corresponding logic in the code. |
Sorry, I wrote that wrongly. What I meant to say is that we don't really use
So at this point, inside Didn't have time to fully investigate the performance implications of this last step (as whenever React recreates all DOM nodes or if it picks them up somehow) so that might be where your suggestion of using |
From what I know (spent a few years fighting among HotLoader) - React always discards the old tree on component change. Replacing fallback with actual component might resolve to the same HTML, but the original DOM tree would be rejected.
|
original issue
facebook/react#16938
test which explains everything
https://github.com/facebook/react/pull/16945/files#diff-ab371863932cd2e8f0ba14ff2eaab380R687
Mostly for your information.
The last React version which will work out of the box with the provided examples API is
16.9
. After that one has to use<Suspense fallback={undefined}>
during the hydration, or it will fail.In other words this moment might be changed a little -
renderFallback
should returnundefined
during hydrationreact-loosely-lazy/src/suspense/component.tsx
Lines 116 to 118 in f3f19d0
Questions yet to answer
fallback
and add it usinguseEffect
a render tick later?The text was updated successfully, but these errors were encountered: