dillon1000/react

Commit

Fix context stack misalignment caused by error replay (#12508)

* Add regression tests for error boundary replay bugs

* Ensure the context stack is aligned if renderer throws

* Always throw when replaying a failed unit of work

Replaying a failed unit of work should always throw, because the render
phase is meant to be idempotent, If it doesn't throw, rethrow the
original error, so React's internal stack is not misaligned.

* Reset originalReplayError after replaying

* Typo fix
Browse files
Changed paths3 files
First-parent comparison
M packages/react-reconciler/src/ReactFiberHostContext.js ModifiedM packages/react-reconciler/src/ReactFiberScheduler.js ModifiedA packages/react-reconciler/src/__tests__/ReactIncrementalErrorReplay-test.js Added
Patch

Files changed

Rendering syntax-highlighted changes…