dillon1000/react

Commit

Fix incorrect unmounted state update warning (#18617)

* Fix incorrect unmounted state update warning

We detach fibers (which nulls the  field) when we commit a deletion, so any state updates scheduled between that point and when we eventually flush passive effect destroys won't have a way to check if there is a pending passive unmount effect scheduled for its alternate unless we also explicitly track this for both the current and the alternate.

This commit adds a new DEV-only effect type, `PendingPassiveUnmountDev`, to handle this case.
Browse files
Changed paths4 files
First-parent comparison
M packages/react-reconciler/src/ReactFiberWorkLoop.new.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.old.js ModifiedM packages/react-reconciler/src/ReactSideEffectTags.js ModifiedM packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…