dillon1000/react

Commit

[Bugfix] Prevent already-committed setState callback from firing again during a rebase (#21498)

* Failing test: Class callback fired multiple times

Happens during a rebase (low priority update followed by high priority
update). The high priority callback gets fired twice.

* Prevent setState callback firing during rebase

Before enqueueing the effect, adds a guard to check if the update was
already committed.
Browse files
Changed paths3 files
First-parent comparison
M packages/react-reconciler/src/ReactUpdateQueue.new.js ModifiedM packages/react-reconciler/src/ReactUpdateQueue.old.js ModifiedA packages/react-reconciler/src/__tests__/ReactClassSetStateCallback-test.js Added
Patch

Files changed

Rendering syntax-highlighted changes…