notes
notes copied to clipboard
animation starts with same random position after every loop
state = {
animation: new Animated.ValueXY({x:Math.random(), y:0}),
} componentDidMount() {
Animated.loop(
Animated.sequence([
Animated.delay(0),
Animated.timing(
this.state.animation,
{
toValue: {x:Math.random(),y:150},
easing: Easing.ease,
duration: 1000
} ),
]),
{
iterations: 5
},
).start();
}