actual/packages/mobile/patches/react-native+0.65.1.patch

36 lines
1.8 KiB
Diff
Raw Normal View History

2022-04-29 02:44:38 +00:00
diff --git a/node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js b/node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js
index efb12af..64ac43f 100644
--- a/node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js
+++ b/node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js
@@ -55,7 +55,7 @@ function configureNext(
}
animationCompletionHasRun = true;
clearTimeout(raceWithAnimationId);
- onAnimationDidEnd?.();
+ onAnimationDidEnd && onAnimationDidEnd();
};
const raceWithAnimationId = setTimeout(
onAnimationComplete,
@@ -64,9 +64,9 @@ function configureNext(
// In Fabric, LayoutAnimations are unconditionally enabled for Android, and
// conditionally enabled on iOS (pending fully shipping; this is a temporary state).
- const FabricUIManager: FabricUIManagerSpec = global?.nativeFabricUIManager;
- if (FabricUIManager?.configureNextLayoutAnimation) {
- global?.nativeFabricUIManager?.configureNextLayoutAnimation(
+ const FabricUIManager: FabricUIManagerSpec = global.nativeFabricUIManager && global.nativeFabricUIManager;
+ if (FabricUIManager && FabricUIManager.configureNextLayoutAnimation) {
+ global.nativeFabricUIManager.configureNextLayoutAnimation && global.nativeFabricUIManager.configureNextLayoutAnimation(
config,
onAnimationComplete,
onAnimationDidFail ??
@@ -78,7 +78,7 @@ function configureNext(
// This will only run if Fabric is *not* installed.
// If you have Fabric + non-Fabric running in the same VM, non-Fabric LayoutAnimations
// will not work.
- if (UIManager?.configureNextLayoutAnimation) {
+ if (UIManager.configureNextLayoutAnimation && UIManager.configureNextLayoutAnimation) {
UIManager.configureNextLayoutAnimation(
config,
onAnimationComplete ?? function() {},