README
useinterval
React hook for setting up an interval
Install
npm install --save useinterval
Usage
import React, { useState } from 'react'
import { useInterval } from 'useinterval'
const App = () => {
let [example, setExample] = useState(0)
useInterval(() => {
setExample(x => setExample(x + 1))
}, 1000)
return (
<div>
{example}
</div>
)
}
export default App
License
MIT © slynch13
This hook is created using create-react-hook.