-
-
Notifications
You must be signed in to change notification settings - Fork 408
feat(react-virtual): add useFlushSync option #1100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 0c8a499 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
View your CI Pipeline Execution ↗ for commit 0c8a499
☁️ Nx Cloud last updated this comment at |
channyeintun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed — the solution is pretty straightforward and the implementation is clean. Nice work.
🎯 Changes
Adds a React-specific configuration flag (useFlushSync) to @tanstack/react-virtual to control whether flushSync is used for synchronous scroll correction during measurement.
flushSync is intentionally used to limit visible whitespace during fast scrolling with dynamically measured items. In React 19 this triggers a warning when called from useLayoutEffect, but the warning itself does not affect correctness in this case.
Instead of changing the default behavior to silence the warning, this PR makes the behavior explicit and opt-out:
This keeps backward compatibility while allowing React 19 users to opt out if desired.
✅ Checklist
pnpm run test:pr.🚀 Release Impact