# `useInterval` A declarative interval hook based on [Dan Abramov's article on overreacted.io](https://overreacted.io/making-setinterval-declarative-with-react-hooks). The interval can be paused by setting the delay to `null`. ## Usage ```jsx import * as React from 'react'; import {useInterval} from 'react-use'; const Demo = () => { const [count, setCount] = React.useState(0); const [delay, setDelay] = React.useState(1000); const [isRunning, toggleIsRunning] = useBoolean(true); useInterval( () => { setCount(count + 1); }, isRunning ? delay : null ); return (