I implemented react-window and react-virtualized-auto-sizer.
My problem is that it crashes. It says Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
import AutoSizer from 'react-virtualized-auto-sizer'
import { FixedSizeList as List } from 'react-window'
...
{
!isRetrievingProducts &&
products?.length > 0 &&
products?.map((product, productIndex) => (
<AutoSizer>
{({ height, width }) => (
<List
className="List"
height={height}
itemCount={5}
itemSize={35}
width={width}
>
<Grid
key={product?.productCode || productIndex}
component="div"
container
>
<Grid
component="div"
item
xl={10}
lg={12}
md={12}
sm={12}
xs={12}
>
<ProductCard productIndex={productIndex} product={product} />
</Grid>
</Grid>
</List>
)}
</AutoSizer>
));
}