dillon1000/react
Commit
Browse files Fix: Use action implementation at time of dispatch (#29618)
Fixes the behavior of actions that are queued by useActionState to use the action function that was current at the time it was dispatched, not at the time it eventually executes. The conceptual model is that the action is immediately dispatched, as if it were sent to a remote server/worker. It's the remote worker that maintains the queue, not the client. This is another property of actions makes them more like event handlers than like reducers.
Changed paths2 files
First-parent comparisonpackages/react-dom/src/__tests__/ReactDOMForm-test.js ModifiedM packages/react-reconciler/src/ReactFiberHooks.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…