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
{{ message }}
Repository navigation
[v3.0.0-beta.63] Items not displayed in SSR with "useWindowVirtualizer" #599
On the version : v3.0.0-beta.63
When we SSR (Next or Remix) a page with "useWindowVirtualizer", the items do not display (because not returned by "getVirtualItems()") before we scroll.
If we can't scroll (because page is small) then the items never display.
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.
@raskyer can you create codesandbox example? I think issue here is that you are passing scroll element via ref, if you store it on state then it should work, also for SSR you can specify initialRect.
I have difficulties to create sandbox right now (codesandbox seems down).
yep, codesandbox is getting really slow lately, managed to create this https://codesandbox.io/p/sandbox/busy-feistel-hdtxsr ( using the official template ). Not up to date with next stuff but this kinda looks ok.
It was working without any issue at 60. But have an issue since 61, 62 or 63.
hmm, this is bit surprising as 61 should not affect this, but 63 yes, as we changed to don't return empty items when the size of scroller is 0.
I would say that virtualizer don't know that it's on client side now and should re-render, as we only watch resize events. For quick fix you can try force re-render in effect.
yep, codesandbox is getting really slow lately, managed to create this https://codesandbox.io/p/sandbox/busy-feistel-hdtxsr ( using the official template ). Not up to date with next stuff but this kinda looks ok.
Could not access it, unfortunatly.
hmm, this is bit surprising as 61 should not affect this, but 63 yes, as we changed to don't return empty items when the size of scroller is 0.
Activity
piecyk commentedon Oct 6, 2023
@raskyer can you create codesandbox example? I think issue here is that you are passing scroll element via ref, if you store it on state then it should work, also for SSR you can specify
initialRect.raskyer commentedon Oct 6, 2023
I have difficulties to create sandbox right now (codesandbox seems down).
But my component do not use ref or parent :
It was working without any issue at 60. But have an issue since 61, 62 or 63.
piecyk commentedon Oct 6, 2023
ooo true, as it's Window
yep, codesandbox is getting really slow lately, managed to create this https://codesandbox.io/p/sandbox/busy-feistel-hdtxsr ( using the official template ). Not up to date with next stuff but this kinda looks ok.
hmm, this is bit surprising as 61 should not affect this, but 63 yes, as we changed to don't return empty items when the size of scroller is 0.
I would say that virtualizer don't know that it's on client side now and should re-render, as we only watch resize events. For quick fix you can try force re-render in effect.
raskyer commentedon Oct 6, 2023
Could not access it, unfortunatly.
3.61 is fine too (just tested it right now)
piecyk commentedon Oct 7, 2023
@raskyer can't really reproduce it, looks ok with next 12 https://codesandbox.io/s/late-fog-qqjs5v?file=/pages/index.js
as mention above, by adding initialRect, the rows will be render also on server.
raskyer commentedon Oct 7, 2023
@piecyk Can you create the same example with remix 1.19.3 ?
I don't think it has anything to do with remix / next but that would be cool to try in the same conditions.
I struggle alot trying to do this in codesandbox (really buggy).
raskyer commentedon Oct 7, 2023
Ok, here the mini repo : https://github.com/raskyer/virtual-bug
It happen when there is 1 element in count.
piecyk commentedon Oct 9, 2023
@raskyer should be fixed in latest beta.