how to create a moving and flashing star #1715
-
Hi, everyone. demo: https://codesandbox.io/s/hardcore-rosalind-0tjvf?file=/src/App.js when not moving, it flashing, but when moving, flashing(opacity) not work |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You were updating the state to change the values of your spring, which is okay if its one value or another, but I wouldn't advising doing it like you were doing it – updating in an interval. You might find it easier to use the imperative API we provide as can be seen in this code sandbox – https://codesandbox.io/s/hopeful-pike-kvsju?file=/src/App.js |
Beta Was this translation helpful? Give feedback.
You were updating the state to change the values of your spring, which is okay if its one value or another, but I wouldn't advising doing it like you were doing it – updating in an interval.
You might find it easier to use the imperative API we provide as can be seen in this code sandbox – https://codesandbox.io/s/hopeful-pike-kvsju?file=/src/App.js