Rock YouTube channel with real views, likes and subscribers
Get Free YouTube Subscribers, Views and Likes

Debounce input field in React using useEffect setTimeout

Follow
Novel Code

This video is about debouncing an input field in react js to reduce your api calls in search inputs and improve the performance of the app. Debouncing in this video is achieved by using useEffect hook and setTimeout function. first we make the input a controlled input by using an onchange handler and by feeding the input its value. we use setTimeout inside of our useEffect and and check for the entered username is available in json or not. we clear the timeout. we set a state for our validation message. we debounce. messi is the goat. we use the some method to check in json array. we conclude.

posted by parostwow9