Skip to content

fix: do not overwrite local search component state while we are still debouncing#748

Open
TkDodo wants to merge 1 commit intomainfrom
feature/debounce-fix
Open

fix: do not overwrite local search component state while we are still debouncing#748
TkDodo wants to merge 1 commit intomainfrom
feature/debounce-fix

Conversation

@TkDodo
Copy link
Contributor

@TkDodo TkDodo commented Mar 8, 2026

the problematic flow was:

  • type something in the filter input
  • stop for a bit so that debounce writes to the url
  • continue typing

--> now sometimes, the local state was re-set to what the url contained, because of the unconditional useEffect.

The fix is to have a useDebouncer, which knows when debouncing is pending and then ignore updates that come in while a debounce is scheduled, as that means the user has already continued typing.

@netlify
Copy link

netlify bot commented Mar 8, 2026

Deploy Preview for tanstack ready!

Name Link
🔨 Latest commit c757b5e
🔍 Latest deploy log https://app.netlify.com/projects/tanstack/deploys/69adcbfaf89de700087d055d
😎 Deploy Preview https://deploy-preview-748--tanstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 22 (🔴 down 1 from production)
Accessibility: 90 (no change from production)
Best Practices: 75 (no change from production)
SEO: 97 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@TkDodo TkDodo requested a review from KevinVandy March 8, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant