DEV Community

Discussion on: Debouncing with React Hooks

Collapse
johanse7 profile image
johanse7

how do you make the call debounce function ?

Collapse
dextermb profile image
Dexter Marks-Barber
const onChange = debounce(event => setQuery(event?.target?.value))
Enter fullscreen mode Exit fullscreen mode
Thread Thread
rohan2734 profile image
rohan2734 • Edited on

nope not working , geting the state value as undefined

Thread Thread
dextermb profile image
Dexter Marks-Barber

Are you able to show your code for the event handler and how you trigger the call?

Thread Thread
rohan2734 profile image
rohan2734

i have triggered the call in the same way, but it is not working at all ,and state is undefined