dillon1000/react

Commit

Update callbacks

Callbacks are stored on the same queue as updates. They care called
during the commit phase, after the updates have been flushed.

Because the update queue is cleared during the completion phase (before
commit), a new field has been added to fiber called callbackList. The
queue is transferred from updateQueue to callbackList during completion.
During commit, the list is reset.

Need a test to confirm that callbacks are not lost if an update is
preempted.
Browse files
Changed paths6 files
First-parent comparison
M src/renderers/shared/fiber/ReactFiber.js ModifiedM src/renderers/shared/fiber/ReactFiberBeginWork.js ModifiedM src/renderers/shared/fiber/ReactFiberCommitWork.js ModifiedM src/renderers/shared/fiber/ReactFiberCompleteWork.js ModifiedM src/renderers/shared/fiber/ReactFiberUpdateQueue.js ModifiedM src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…