dillon1000/react
Commit
Browse files useActionState: Transfer transition context (#29694)
Mini-refactor of useActionState to only wrap the action in a transition context if the dispatch is called during a transition. Conceptually, the action starts as soon as the dispatch is called, even if the action is queued until earlier ones finish. We will also warn if an async action is dispatched outside of a transition, since that is almost certainly a mistake. Ideally we would automatically upgrade these to a transition, but we don't have a great way to tell if the action is async until after it's already run.
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…