Skip to content

animation starts with same random position after every loop #7

@vishal-raj15

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions