1

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>
    ));
}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.