react-lottie icon indicating copy to clipboard operation
react-lottie copied to clipboard

setSpeed is not called with initial speed

Open sindreij opened this issue 6 years ago • 3 comments

If I do something like

<Lottie options={options} height={250} width={250} speed={0.5} />

the animation will run with the default speed, not 0.5 as intended. This is because setSpeed is not called in componentDidMount(), only in componentDidUpdate().

sindreij avatar Jun 26 '18 08:06 sindreij

it worked for me. For speed Nx

  componentWillMount(){
    this.setState({},_=>this.setSpeed())
  }
  setSpeed(){
    this.setState({speed: N})
  }

carlossrb avatar Aug 02 '19 04:08 carlossrb

Same here

david-blox avatar Jun 07 '20 15:06 david-blox

it worked for me. For speed Nx

  componentWillMount(){
    this.setState({},_=>this.setSpeed())
  }
  setSpeed(){
    this.setState({speed: N})
  }

this worked for me

zovanni avatar Jan 27 '21 09:01 zovanni