use-debounce-hook
v1.0.3
Published
useDebounce Hook
Downloads
6
Readme
use-debounce-hook
Install
npm install --save use-debounce-hook
Usage
import React, { useState } from 'react';
import { useDebounce } from 'use-debounce';
const App = () => {
const [value, setValue] = useState('');
const text = useDebounce(value);
//ou const text = useDebounce(value, 1000); timeout configuration
return (
<div>
<div>
<input
type="text"
value={value}
onChange={(e) => setValue(e.target.value)}
/>
</div>
<div>{text}</div>
</div>
);
};
export default App;
License
MIT © fulviocanducci
Example on-line
This hook is created using create-react-hook.