6

How to Create an Instant Search Input with Debounce in React.js

 2 years ago
source link: https://hackernoon.com/how-to-create-an-instant-search-input-with-debounce-in-reactjs
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to Create an Instant Search Input with Debounce in React.js

Debounce is a practice used to ensure that time-consuming tasks do not fire so often, that it stalls the performance of the web page. The project had an input field where you could type in the name of an anime to search for. The text typed in the input field was then used to query the API for animes matching the input. To prevent making a call to the API on every keystroke, I had to debounce the queries. This is done to limit the rate at which a function gets invoked.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK