Closed Risyandi closed 1 year ago
you should wrap the function you pass into useCallback hook.
{
const debouncedOnClick = useCallback(
debounce(() => {
/* your code goes here */
}, 400),
[/* do not forget to set dependencies for your code*/]
)
...
}
Hi, @JustFly1984 Thank you for your response, I will try the solution. hopefully will be working fine.
how to add debounce at best places (onload, onPlaceChanged, or etc) in Autocomplete using this function for example debounce.
Environment
os: windows
react version : 16.13.1
@react-google-maps/api version : 1.8.9