react-lottie
react-lottie copied to clipboard
setSpeed is not called with initial speed
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()
.
it worked for me. For speed Nx
componentWillMount(){
this.setState({},_=>this.setSpeed())
}
setSpeed(){
this.setState({speed: N})
}
Same here
it worked for me. For speed Nx
componentWillMount(){ this.setState({},_=>this.setSpeed()) } setSpeed(){ this.setState({speed: N}) }
this worked for me