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
Link to code example: https://codesandbox.io/s/busy-jang-75wmf
The layout-dependent component is rendered incorrectly based on when it was still invisible.
The layout-dependent component should render correctly regardless of whether or not siblings are lazy and caused suspense.
cc @lunaruan in case this ties into the hidden stuff any.
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.
Most helpful comment
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.