Enables Basic View Transition support for React Native Fabric renderer (#35764)

## Summary

Enables Basic View Transition support for React Native Fabric renderer.

**Implemented:**
- Added FabricUIManager bindings for view transition methods:
`applyViewTransitionName`, `startViewTransition`
- Implemented `startViewTransition` with proper callback orchestration
(mutation → layout → afterMutation → spawnedWork → passive)
- Added fallback behavior that flushes work synchronously when Fabric's
`startViewTransition` returns null (e.g., when the ViewTransition
ReactNativeFeatureFlag is not enabled)
- Added Flow type declarations for new FabricUIManager methods
- Stubbed with `__DEV__` warnings for all the other view transition
config functions that are not yet implemented

This allows React Native apps using Fabric to leverage the View
Transition API for coordinated animations during state transitions, with
graceful degradation when the native side doesn't support it.

Below are diagrams of proposed architecture in fabric, and observation
of what/when config functions get called during a basic shared
transition example

<img width="2290" height="1529" alt="Untitled-2026-03-19-1240"
src="https://github.com/user-attachments/assets/192c9169-bc25-449c-a33b-dfec67179e7f"
/>

## How did you test this change?

- [x] `yarn flow fabric` - Flow type checks pass
- [x] `yarn lint` - Lint checks pass
- [x] Manually tested in Android catalyst app with
`enableViewTransition` and `enableViewTransitionForPersistenceMode `in
`ReactFeatureFlags.test-renderer.native-fb.js` and View Transition
enabled via ReactNativeFeatureFlag
- [x] Verified in the minified `ReactFabric-dev.fb.js` that the 'shim'
config functions are not included
- [x] Verified fallback behavior logs warning in `__DEV__` and flushes
work synchronously when ViewTransition flag isn't enabled in Fabric
This commit is contained in:
Zeya Peng
2026-03-19 17:58:29 -04:00
committed by GitHub
parent 709be9d417
commit 4e0280e3c7
16 changed files with 422 additions and 24 deletions
+2 -1
View File
@@ -567,5 +567,6 @@
"579": "Invalid data for bytes stream.",
"580": "Server Function has too many bound arguments. Received %s but the limit is %s.",
"581": "BigInt is too large. Received %s digits but the limit is %s.",
"582": "Referenced Blob is not a Blob."
"582": "Referenced Blob is not a Blob.",
"583": "The current renderer does not support view transitions. This error is likely caused by a bug in React. Please file an issue."
}