dillon1000/react

Commit

Fix: useOptimistic should return passthrough value when there are no updates pending (#27936)

This fixes a bug that happened when the canonical value passed to
useOptimistic without an accompanying call to setOptimistic. In this
scenario, useOptimistic should pass through the new canonical value.

I had written tests for the more complicated scenario, where a new value
is passed while there are still pending optimistic updates, but not this
simpler one.
Browse files
Changed paths2 files
First-parent comparison
M packages/react-reconciler/src/ReactFiberHooks.js ModifiedM packages/react-reconciler/src/__tests__/ReactAsyncActions-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…