Package Exports
- react-use-debounce
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-use-debounce) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-use-debounce
基于 react hooks 的防抖函数
npm install --save react-use-debounce
import React from 'react';
import useDebouncedCallback from 'react-use-debounce';
const = () => {
const [debouncedCallback] = useDebouncedCallback(() => console.log('test'), 500);
return (
<div>
<input type="text" onChange={debouncedCallback} />
</div>
)
}