dillon1000/react
Commit
Browse files Fix an infinite loop in new context (#12402)
* Add a regression test for the context infinite loop * Fix the bug We set .return pointer inside the loop, but the top-level parent-child relationship happens outside. This ensures the top-level parent's child points to the right copy of the parent. Otherwise we may end up in a situation where (workInProgress === nextFiber) is never true and we loop forever.
Changed paths2 files
First-parent comparisonpackages/react-reconciler/src/ReactFiberBeginWork.js ModifiedM packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…