dillon1000/react

Commit

Fix unwinding starting with a wrong Fiber on error in the complete phase (#13237)

* Add a repro case for profiler unwinding

This currently fails the tests due to an unexpected warning.

* Add a regression test for context stack

* Simplify the first test case

* Update nextUnitOfWork inside completeUnitOfWork()

The bug was caused by a structure like this:

    </Provider>
  </div>
</errorInCompletePhase>

We forgot to update nextUnitOfWork so it was still pointing at Provider when errorInCompletePhase threw. As a result, we would try to unwind from Provider (rather than from errorInCompletePhase), and thus pop the Provider twice.
Browse files
Changed paths3 files
First-parent comparison
M packages/react-reconciler/src/ReactFiberScheduler.js ModifiedM packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js ModifiedM packages/react/src/__tests__/ReactProfiler-test.internal.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…