Skip to main content

Nov 2026 · Guide · ~7 min read

Debounce vs Throttle in React — When Each One Wins

By Safdar Ali — frontend engineer, Bengaluru

I'm Safdar Ali. Debounce delays the work until the user pauses. A search field should debounce. You want one request after they stop typing, not one per letter.

Throttle guarantees a call at most once per interval while the events keep coming. A scroll listener that updates a position can throttle. Waiting for the scroll to end would feel stuck.

The React bug is creating the timer inside render or inside an effect that depends on a value that changes every keystroke, so the timer resets and the debounced function never runs. Keep the function stable, or store the timer in a ref.

Do not debounce the state that paints the input. The field should update on each key. Debounce the request that uses the value. Controlled input that waits 300 milliseconds feels broken even when the network call is correct.

If the work is cheap, do neither. A throttle on a handler that sets two pieces of state is ceremony. Measure a janky scroll before you add a timer.

If this helped you

I publish free tutorials and write-ups like this in my spare time — no paywall on the guides. If it saved you an afternoon of trial and error, you can support the work:

More guides on safdarali.in — same author, production-focused.

"Talk is cheap. Show me the code."