Skip to content

Commit 1ddff43

Browse files
authored
Add null check before calling fabricSuspendOnActiveViewTransition (#36310)
## Summary - Adds a null check before calling `fabricSuspendOnActiveViewTransition()` in the Fabric renderer's `suspendOnActiveViewTransition` export - Prevents crashes on hosts where `nativeFabricUIManager` does not yet implement `suspendOnActiveViewTransition` ## Test plan - Verified the change compiles correctly - Hosts with `suspendOnActiveViewTransition` implemented continue to work as before - Hosts without `suspendOnActiveViewTransition` no longer crash when view transitions are active
1 parent d1727fb commit 1ddff43

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,9 @@ export function suspendOnActiveViewTransition(
657657
state: SuspendedState,
658658
container: Container,
659659
): void {
660-
fabricSuspendOnActiveViewTransition();
660+
if (fabricSuspendOnActiveViewTransition != null) {
661+
fabricSuspendOnActiveViewTransition();
662+
}
661663
}
662664

663665
export function waitForCommitToBeReady(

0 commit comments

Comments
 (0)