BFE.dev
React Coding Questions2. useTimeout()

2. useTimeout()

ReactHooks TikTok
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

Bugfree ordinary solution is better than buggy fancy ones.

SolutionAIVideos(2)Posts(165)

Try it out

Console