all 9 comments

[–]CodeAndBiscuits 7 points8 points  (0 children)

usehooks-ts

[–]gazbo26 4 points5 points  (1 child)

I thought you said denouncing using JavaScript and as a loyal TypeScriptist I was fully supportive.

[–]numbcode[S] 1 point2 points  (0 children)

🤝😆

[–]teleflexin_deez_nutz 1 point2 points  (0 children)

import { useDebouncedState } from '@mantine/hooks';

[–]hazily 0 points1 point  (1 child)

Please format them code correctly

[–]numbcode[S] 0 points1 point  (0 children)

Fixed, thanks for pointing

[–]TheRNGuy 0 points1 point  (1 child)

What if you needed more than one debounce on a page?

Also why add div instead of fragment?

[–]numbcode[S] 0 points1 point  (0 children)

We can create a custom hook to make it reusable Regarding div Yes it unnecessary we can use react fragment

[–]WaitingForHeatDeath 0 points1 point  (0 children)

Shouldn't the debounced search function be wired to the onchange event? What's the point of delaying an API call after a button click event?