Last active
April 26, 2021 21:43
-
-
Save javiercr/6359af65d8578568d4bc7ed159744464 to your computer and use it in GitHub Desktop.
react-native 0.64 patch for `Container is falsy in LayoutAnimation` error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js b/node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js | |
index 91949ed..2ac03b1 100644 | |
--- a/node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js | |
+++ b/node_modules/react-native/Libraries/LayoutAnimation/LayoutAnimation.js | |
@@ -32,7 +32,7 @@ function configureNext( | |
onAnimationDidFail?: OnAnimationDidFailCallback, | |
) { | |
if (!Platform.isTesting) { | |
- if (UIManager?.configureNextLayoutAnimation) { | |
+ if (UIManager && UIManager.configureNextLayoutAnimation) { | |
UIManager.configureNextLayoutAnimation( | |
config, | |
onAnimationDidEnd ?? function() {}, | |
@@ -40,9 +40,9 @@ function configureNext( | |
function() {} /* this should never be called in Non-Fabric */, | |
); | |
} | |
- const FabricUIManager: FabricUIManagerSpec = global?.nativeFabricUIManager; | |
- if (FabricUIManager?.configureNextLayoutAnimation) { | |
- global?.nativeFabricUIManager?.configureNextLayoutAnimation( | |
+ const FabricUIManager: FabricUIManagerSpec = global && global.nativeFabricUIManager; | |
+ if (FabricUIManager && FabricUIManager.configureNextLayoutAnimation) { | |
+ global.nativeFabricUIManager.configureNextLayoutAnimation( | |
config, | |
onAnimationDidEnd ?? function() {}, | |
onAnimationDidFail ?? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment