#Animation not stopping rightW

3 messages · Page 1 of 1 (latest)

analog coral
#

I don't do react, but must this

const toggleAnimation = () => {
    setIsAnimating(prevState => !prevState);
  };```
not rather be
```js
const toggleAnimation = () => {
    setIsAnimating(isAnimating = !sAnimating);
  };```
?
vapid blaze
analog coral
#

It stops on its own? Or when you stop it it doesn't keep the current state?