You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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…
constvirtualizer=useWindowVirtualizer({count: branches.length,estimateSize: ()=>66,overscan: 5,scrollMargin: listRef.current?.offsetTop??0,});// we do this because react 19 was optimzing it awayconstvirtualizerRef=useRef(virtualizer);…virtualizerRef.current.getVirtualItems()// etc…
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
I agree to follow this project's Code of Conduct
I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
The text was updated successfully, but these errors were encountered:
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: