QuestionWeb AppWeb app. runs in the browser resolved
debouncing a search input the right way in React
my search fires a request per keystroke and hammers the DB. I know debounce is the answer but the useEffect cleanup keeps confusing me.
2 answers
my search fires a request per keystroke and hammers the DB. I know debounce is the answer but the useEffect cleanup keeps confusing me.
you are closer than you think. it is the ordering — do the setup step before the call.
this bit me too. short version: it is a timing thing. move it into the load step.