BFE.dev
React コーディング問題8. useDebounce()

8. useDebounce()

ReactHooks
シェアしよう

  - accepted / - tried

For a frequently changing value like text input you might want to debounce the changes.

Implement useDebounce() to achieve this.

function App() {  const [value, setValue] = useState(...)  // this value changes frequently,   const debouncedValue = useDebounce(value, 1000)  // now it is debounced}

The logic should be similar to 6. implement basic debounce()

前へ次へ

時間と空間複雑性はどう?

解答AI投稿(108)

Try it out

Console