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
As reported in #14536, React mounts suspended components to the DOM with display:none and fires effects before the components are visible. Once suspense has completed, effects are not re-run. This means that any component that reads layout info from the DOM becomes visible with content based on a stale layout.
React version: 16.12.0
Steps To Reproduce
Create a component that reads layout info from the DOM
Render that component in a suspense alongside a lazy component
My understanding is that this is not possible to fix in the legacy (ReactDOM.render) mode. Sorry. It's a quirk of the legacy mode which we can't fix without introducing other breaking changes. This is solved in Blocking Mode and Concurrent Mode, but they are only available in experimental releases for now.
As reported in #14536, React mounts suspended components to the DOM with
display:none
and fires effects before the components are visible. Once suspense has completed, effects are not re-run. This means that any component that reads layout info from the DOM becomes visible with content based on a stale layout.React version: 16.12.0
Steps To Reproduce
Link to code example: https://codesandbox.io/s/busy-jang-75wmf
The current behavior
The layout-dependent component is rendered incorrectly based on when it was still invisible.
The expected behavior
The layout-dependent component should render correctly regardless of whether or not siblings are lazy and caused suspense.
The text was updated successfully, but these errors were encountered: