Skip to content

Commit fe51601

Browse files
authored
Wire up startViewTransitionReadyFinished in Fabric (#36246)
## Summary - Imports `startViewTransitionReadyFinished` from `nativeFabricUIManager` in `ReactFiberConfigFabricWithViewTransition` - Calls `fabricStartViewTransitionReadyFinished()` when the view transition `ready` promise resolves This is not a config function, but it's helpful to have it notify fabric ViewTransition runtime when ready callback is done. Right now we're testing animation kicked off from view transition event handlers, this is signal to know when animations that belong to a transition have all started. ## Test plan - Existing Fabric renderer tests should continue to pass - View transition ready callback now notifies the native module when finished
1 parent ea67920 commit fe51601

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/react-native-renderer/src/ReactFiberConfigFabricWithViewTransition.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import type {
1919
const {
2020
applyViewTransitionName: fabricApplyViewTransitionName,
2121
startViewTransition: fabricStartViewTransition,
22+
startViewTransitionReadyFinished: fabricStartViewTransitionReadyFinished,
2223
} = nativeFabricUIManager;
2324

2425
export type InstanceMeasurement = {
@@ -251,6 +252,7 @@ export function startViewTransition(
251252

252253
transition.ready.then(() => {
253254
spawnedWorkCallback();
255+
fabricStartViewTransitionReadyFinished();
254256
});
255257

256258
transition.finished.finally(() => {

scripts/flow/react-native-host-hooks.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,5 +217,6 @@ declare const nativeFabricUIManager: {
217217
finished: Promise<void>,
218218
ready: Promise<void>,
219219
},
220+
startViewTransitionReadyFinished: () => void,
220221
...
221222
};

0 commit comments

Comments
 (0)