dillon1000/react
Commit
Browse files Fix useMutableSource tearing bug (#18912)
* Failing useMutableSource test If a source is mutated after initial read but before subscription is set up, it should still entangle all pending mutations even if snapshot of new subscription happens to match. Test case illustrates how not doing this can lead to tearing. * Fix useMutableSource tearing bug Fix is to move the entanglement call outside of the block that checks if the snapshot has changed.
Changed paths3 files
First-parent comparisonpackages/react-reconciler/src/ReactFiberHooks.new.js ModifiedM packages/react-reconciler/src/ReactFiberHooks.old.js ModifiedM packages/react-reconciler/src/__tests__/useMutableSource-test.internal.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…