Debouncing is crucial for search inputs to avoid spamming your API. Let's encapsulate this logic in a reusable hook.
useDebounce(value, delay)debouncedValue that only updates after the delay has passed without changesuseEffect with a timeout and cleanupSubmit your code to see test results