diff --git a/Libraries/LayoutAnimation/LayoutAnimation.js b/Libraries/LayoutAnimation/LayoutAnimation.js index 2001729e004..561ef2f71d9 100644 --- a/Libraries/LayoutAnimation/LayoutAnimation.js +++ b/Libraries/LayoutAnimation/LayoutAnimation.js @@ -19,6 +19,7 @@ import type { } from '../Renderer/shims/ReactNativeTypes'; import Platform from '../Utilities/Platform'; +import ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags'; // Reexport type export type LayoutAnimationConfig = LayoutAnimationConfig_; @@ -26,10 +27,11 @@ export type LayoutAnimationConfig = LayoutAnimationConfig_; type OnAnimationDidEndCallback = () => void; type OnAnimationDidFailCallback = () => void; -let isLayoutAnimationEnabled: boolean = true; +let isLayoutAnimationEnabled: boolean = + ReactNativeFeatureFlags.isLayoutAnimationEnabled(); function setEnabled(value: boolean) { - isLayoutAnimationEnabled = value; + isLayoutAnimationEnabled = isLayoutAnimationEnabled; } /** diff --git a/Libraries/ReactNative/ReactNativeFeatureFlags.js b/Libraries/ReactNative/ReactNativeFeatureFlags.js index 89f4334d23c..90a9eee5180 100644 --- a/Libraries/ReactNative/ReactNativeFeatureFlags.js +++ b/Libraries/ReactNative/ReactNativeFeatureFlags.js @@ -11,6 +11,10 @@ 'use strict'; export type FeatureFlags = {| + /** + * Function used to enable / disabled Layout Animations in React Native. + * Default value = true. + */ isLayoutAnimationEnabled: () => boolean, |};