notes icon indicating copy to clipboard operation
notes copied to clipboard

animation starts with same random position after every loop

Open vishal-raj15 opened this issue 5 years ago • 0 comments

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();
}

vishal-raj15 avatar Jan 13 '20 20:01 vishal-raj15