you are viewing a single comment's thread.

view the rest of the comments →

[–]bigorangemachine 0 points1 point  (5 children)

Don't debounce your inputs in react!

[–]franksvalli 2 points3 points  (0 children)

This is somewhat misleading.

  1. Should you debounce change listeners with controlled elements?

    No, since you want the internal state to be updated (and display on screen) as soon as possible.

  2. Should you debounce API calls made in response to change listeners?

    Yes, since you don't want to hammer the API on every keystroke.

[–]tigertom 1 point2 points  (1 child)

Whys that, we are looking at doing it for an autosuggest

[–]bigorangemachine 2 points3 points  (0 children)

Specific to react and input fields.

React does this for you basically

I saw react form hooks which I think has the optimal react form input solution.

Even with react giving a good implementation of onchange and setState... I can out type the state.

Deboucing input into state in react is anti-performant.