-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
React 19 issue with useWindowVirtualizer #743
Comments
same issue here, but droppind a virtualizer in a ref does not helps |
Running into the same issue. |
It gives me an issue with eslint however.
Edit: it might be removed in a PR |
+1, I am seeing this with: {
"@tanstack/react-virtual": "^3.11.1",
"react": "^18.3.1",
"react-compiler-runtime": "^19.0.0-beta-63b359f-20241101",
"react-dom": "^18.3.1",
} Putting a hook in the component after Another option is "use no memo" https://react.dev/learn/react-compiler#something-is-not-working-after-compilation |
Yep, 'use no memo' seems like a reasonable temporary workaround! 👍 |
Describe the bug
Sorry for the drive by issue…
We ran into a problem with react 19 today that was a pita to track down. So dropping it here incase it's useful to anyone.
We had a simple useWindowVirutalizer in a client component in next.js w/ react 19 (like this):
and virtualizerRef.getVirtualItems() was being hoisted / memo'd by the compiler in such a way that it was always returning 0 for
getVirutalItems
.To fix it we just dropped the virtualizer in a ref…
Your minimal, reproducible example
n/a
Steps to reproduce
Don't have time to spin up a test case sorry!
Expected behavior
Expected getVirtualItems() to return items.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
macos, chrome, react 19
tanstack-virtual version
3.7.0
TypeScript version
No response
Additional context
No response
Terms & Code of Conduct
The text was updated successfully, but these errors were encountered: