mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Refactor LayoutAnimation to use ReactNativeFeatureFlags
Summary: This diff refactors LayoutAnimation to use ReactNativeFeatureFlags.ENABLE_LAYOUT_ANIMATION to enable / disable this feature changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D34349648 fbshipit-source-id: 90d1db6560867e44eeffbf03e5a84edadcdd55f9
This commit is contained in:
committed by
Facebook GitHub Bot
parent
33aba77456
commit
05b4570d3f
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
'use strict';
|
||||
|
||||
export type FeatureFlags = {|
|
||||
/**
|
||||
* Function used to enable / disabled Layout Animations in React Native.
|
||||
* Default value = true.
|
||||
*/
|
||||
isLayoutAnimationEnabled: () => boolean,
|
||||
|};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user