4 ms·
You're being very generous with this code sample. It can get far more complex if you want a custom hook with variable timeout. Dan even had to write a lengthy a
by WickyNilliams 2y ago
You're being very generous with this code sample. It can get far more complex if you want a custom hook with variable timeout. Dan even had to write a lengthy article on the topic. https://overreacted.io/making-setinterval-declarative-with-react-hooks/ https://overreacted.io/making-setinterval-declarative-with-r...