README
Nicer Toolbox
Use Debounce
Debounce a react useState value
Usage
function App() {
const [count, setCount] = useState(0)
const delayedValue = useDebounce(value, 3000)
return (
<div className='App'>
<h1>Counter</h1>
<p>Current count: {value}</p>
<p>Debounce count: {delayedValue}</p>
<button onClick={() => setCount(count + 1)}>Increment</button>
</div>
)
}