Complete the code to import LayoutAnimation from React Native.
import { View, Text, [1] } from 'react-native';
You need to import LayoutAnimation to use it for animating layout changes.
Complete the code to configure the next layout animation with the preset 'easeInEaseOut'.
LayoutAnimation.[1](LayoutAnimation.Presets.easeInEaseOut);The method configureNext tells React Native to animate the next layout change.
Fix the error in the code to enable LayoutAnimation on Android.
if (Platform.OS === 'android' && UIManager.[1]) { UIManager.setLayoutAnimationEnabledExperimental(true); }
On Android, you must call UIManager.setLayoutAnimationEnabledExperimental(true) to enable LayoutAnimation.
Fill both blanks to create a button that triggers a layout animation on press.
import { LayoutAnimation, TouchableOpacity, Text } from 'react-native'; const onPress = () => { LayoutAnimation.[1](LayoutAnimation.Presets.spring); [2](); };
Use configureNext to start the animation and then call a function like updateState to change the layout.
Fill all three blanks to define a LayoutAnimation config object with duration 300, type 'easeInEaseOut', and property 'opacity'.
const config = {
duration: [1],
update: {
type: LayoutAnimation.Types.[2],
property: LayoutAnimation.Properties.[3]
}
};The duration is a number (300 ms), the type is easeInEaseOut, and the property animated is opacity.