Closed osadasami closed 4 years ago
Animation does not play back after second click
I have this component
import React from "react" import { useAnimate } from "react-simple-animate" export default () => { const { play, style, isPlaying } = useAnimate({ start: { transform: "translateX(0px)" }, end: { transform: "translateX(200px)" } }); function handleClick() { play(!isPlaying) console.log('isPlaying: ', isPlaying) } return ( <> <div style={style}> Hello </div> <button onClick={handleClick}> Play </button> </> ); }
I expect that animation will play back after second click but it doesn't and only after double click it plays back
Package version
"react": "^16.13.1", "react-dom": "^16.13.1", "react-scripts": "3.4.3", "react-simple-animate": "^3.3.9"
Do you have a codesandbox?
Create sandbox to demonstrate and same problem there https://codesandbox.io/s/keen-pond-mqxhw?file=/src/App.js
Animation does not play back after second click
I have this component
I expect that animation will play back after second click but it doesn't and only after double click it plays back
Package version