Timing, Spring & Decay
Animated.timing
import { Animated, Easing } from 'react-native';
this.state = { animatedVal: new Animated.Value(0) };
Animated.timing(this.state.animatedVal, {
toValue: 100,
duration: 500,
easing: Easing.inOut(Easing.ease),
delay: 200,
}).start(() => console.log('animation complete'));Animated.spring
import { Animated, Easing } from 'react-native';
this.state = { animatedVal: new Animated.Value(0) };
Animated.spring(this.state.animatedVal, {
toValue: 100,
friction: 7,
tension: 40,
}).start(() => console.log('animation complete'));Animated.decay
Last updated
Was this helpful?