Skip to content

Instantly share code, notes, and snippets.

@javiercr
Last active April 26, 2021 21:43
Show Gist options
  • Save javiercr/6359af65d8578568d4bc7ed159744464 to your computer and use it in GitHub Desktop.
Save javiercr/6359af65d8578568d4bc7ed159744464 to your computer and use it in GitHub Desktop.
react-native 0.64 patch for `Container is falsy in LayoutAnimation` error
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