react-rotation
react-rotation copied to clipboard
Fix autoplay & add initialFrame prop
Example code to issue reproduce:
<Rotation cycle={true} autoPlay={this.state.autoPlay} onChange={(frame) => { if (frame === 10) { this.setState({ autoPlay: false })
Expected behavior: Start initially autoPlay then stop spinning after 10 frame.
Issue: The prop autoPlay changes to false, method stop fires but spinning doesn't stop because of async setTimeout in nextFrame method
Also I added initialFrame prop
@andrepolischuk Could you take a look :)