react-virtualized: Problems with scrolling
I am trying to use List, something like this
<AutoSizer>
{({ height, width }) => (
<List
width={width}
height={height}
rowHeight={48}
rowRenderer={({ index }) => (
<div style={{ height: 48 }} key={index}>Item {index}</div>
)}
rowCount={rows.size}
/>
)}
</AutoSizer>
But instead of smoothly scrolling I get terribly jerky on chrome 61.0.3163.100 https://www.screencast.com/t/I7yRYcu71 on FF 55.0.3 I had empty space at the end https://www.screencast.com/t/JOT1Bswz
Without AutoSizer the problem doesn’t disappear.
I’m using the latest versions of react and react-virtualized.
What am I doing wrong? Who faced such a problem?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 7
- Comments: 24 (1 by maintainers)
@yuristrelets That’s because you should pass style and key (not index) props to your div. rowHeight should be set via component props.
In case anyone is having this issue, passing the style down to whatever actual div is rendered for the row is what fixed this for me.
I had originally passed down the style property to the row component, but I didn’t use that property anywhere in the row. I then passed it down to the base row component which passed the style to the actual div creating the row.
Hope this helps anyone else.
Guys here is the fix https://github.com/bvaughn/react-virtualized/pull/825
still reproducing
I have the same issue as @yuristrelets.
react-virtualized@9.21.1on Chrome 75.0.3770.100. Any news? Taking into account last 3 unresponded comments.facing the same issue, using “react-virtualized”: “^9.22.3”.
@TrySound You’re right! My fault, I didn’t see that it’s necessary to pass
styleadkey. Downgrading to version 9.9.0 and changingrowRenderersolved the problem. Thank you!