I recommend using the useHooks-ts
package to listen for changes and apply a 2000ms delay. This ensures that the value is only returned after the specified time has passed. Using prebuilt, lightweight libraries for these kinds of functionalities is often cleaner and easier to manage. However, it's also important to understand the core concept of debounce. For example, you can refer to this guide: https://usehooks-ts.com/react-hook/use-debounce-callback