useInterval
Opened this issue · 0 comments
thchia commented
Hook to simplify creation and cleanup of setInterval:
function MyComponent() {
useInterval(() => {
// do something every 1s
}, 1000)
return <div>...</div>
}
Opened this issue · 0 comments
Hook to simplify creation and cleanup of setInterval:
function MyComponent() {
useInterval(() => {
// do something every 1s
}, 1000)
return <div>...</div>
}