dillon1000/react

Commit

Support addTransitionType in startGestureTransition (#32792)

Stacked on #32788.

Normally we track `addTransitionType` globally because of the async gap
that can happen in Actions where we lack AsyncContext to associate it
with a particular Transition. This unfortunately also means it's
possible to call outside of `startTransition` which is something we want
to warn for.

We need to be able to distinguish whether `addTransitionType` is for a
regular Transition or a Gesture Transition though.

Since `startGestureTransition` is only synchronous we can track it
within that execution scope and move it to a separate set. Since we know
for sure which call owns it we can properly associate it with that
specific provider's `ScheduledGesture`.

This does not yet handle calling `addTransitionType` inside the render
phase of a gesture. That would currently still be associated with the
next Transition instead.
Browse files
Changed paths11 files
First-parent comparison
M fixtures/view-transition/src/components/Page.js ModifiedM packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js ModifiedM packages/react-native-renderer/src/ReactFiberConfigNative.js ModifiedM packages/react-noop-renderer/src/createReactNoop.js ModifiedM packages/react-reconciler/src/ReactFiberGestureScheduler.js ModifiedM packages/react-reconciler/src/ReactFiberTransition.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.js ModifiedM packages/react-test-renderer/src/ReactFiberConfigTestHost.js ModifiedM packages/react/src/ReactSharedInternalsClient.js ModifiedM packages/react/src/ReactStartTransition.js ModifiedM packages/react/src/ReactTransitionType.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…