BFE.dev
buy us
a coffee
Codingproblems
Reactproblems
JavaScriptquizzes
Reactquizzes
TypeScriptpuzzles
CSSproblems
Interviewquestions
SystemDesign
Discussanything
buy us
a coffee

2. useTimeout()

ReactHooks
Share

  - accepted / - tried

Create a hook to easily use setTimeout(callback, delay).

  1. reset the timer if delay changes
  2. DO NOT reset the timer if only callback changes
prevnext

Always try to find a better approach.

Try it out

Console