dillon1000/react
Commit
Browse files Bugfix: Remove extra render pass when reverting to client render (#26445)
(This was reviewed and approved as part of #26380; I'm extracting it into its own PR so that it can bisected later if it causes an issue.) I noticed while working on a PR that when an error happens during hydration, and we revert to client rendering, React actually does _two_ additional render passes instead of just one. We didn't notice it earlier because none of our tests happened to assert on how many renders it took to recover, only on the final output. It's possible this extra render pass had other consequences that I'm not aware of, like messing with some assumption in the recoverable errors logic. This adds a test to demonstrate the issue. (One problem is that we don't have much test coverage of this scenario in the first place, which likely would have caught this earlier.)
Changed paths2 files
First-parent comparisonpackages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js ModifiedM packages/react-reconciler/src/ReactFiberCompleteWork.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…