I am using library called react-window
It's library for efficiently rendering large lists and tabular data.
this is example code from the docs:
import { FixedSizeList as List } from 'react-window';
const Row = ({ index, style }) => (
<div style={style}>Row {index}</div>
);
const Example = () => (
<List
height={150}
itemCount={1000}
itemSize={35}
width={300}
>
{Row}
</List>
);
What I want to do is wrap the {Row} with <div>
or any other custom components.
Because I want to implement some styling and also collapse transition.
Note that, I cannot simply do this:
const Row = ({ index, style }) => (
<div style={{...}}> // wrapper
<div style={style}>Row {index}</div>
</div>
);
Because it will wrap every single list-item with wrapper component, instead of wrap a whole lists with single wrapper component.
I want to wrap a whole lists with single wrapper component.