DEV Community

Discussion on: Using Lodash Debounce with React Hooks for an Async Data Fetching Input or use a Custom Hook.

Collapse
 
alexdrocks profile image
Alexandre Desroches • Edited

Actually you are right, I managed to make a working example on the same Codesandbox project: codesandbox.io/s/react-debounced-d...

So you can avoid importing Lodash debounce and it works just about the same. The only difference I see is that you have to handle the initial render to NOT trigger the debounced function call. PS: I edited my original post to include this solution.