rehooks/ideas

useInterval

Opened this issue · 0 comments

Hook to simplify creation and cleanup of setInterval:

function MyComponent() {

  useInterval(() => {
    // do something every 1s
  }, 1000)

  return <div>...</div>

}

https://github.com/thchia/useInterval