DEV Community

Discussion on: React useThrottle hook with usage example

Collapse
 
nano1709 profile image
Ignacio Vargas • Edited

Good post!
Question: So it's 500ms by default, but can it be change to other value/response time and so how?

Collapse
 
loonywizard profile image
Vladimir Nikitin

Thanks! Yes, you could pass second argument to useThrottle hook, example for 1000ms:

const throttledValue = useThrottle(value, 1000)
Enter fullscreen mode Exit fullscreen mode