/** * title: 基础使用 * desc: ThrottledValue 每隔 500ms 变化一次。 */ import React, { useState } from 'react'; import useThrottle from "../../useThrottle"; export default () => { const [value, setValue] = useState(); const throttledValue = useThrottle(value, { wait: 500 }); return (
setValue(e.target.value)} placeholder="Typed value" style={{ width: 280 }} />

throttledValue: {throttledValue}

); };