react-use-interval-hook
v1.0.3
Published
A basic useInterval hook for React. Works just like you would expect setInterval to work.
Downloads
5
Maintainers
Readme
react-use-interval-hook
A basic useInterval hook for React. Works just like you would expect setInterval to work.
Install
npm install --save react-use-interval-hook
Usage
import React, { useState } from "react";
import { useInterval } from "react-use-interval-hook";
const ExampleCounter = () => {
const [count, setCount] = useState(0);
useInterval(() => {
setCount(count + 1);
}, 1000);
return <div>Count is: {count}</div>;
};
License
MIT © bnzone