bvaughn / react-window

React components for efficiently rendering large lists and tabular data
https://react-window.now.sh/
MIT License
15.49k stars 778 forks source link

innerElementType doesn't work #754

Open herzaso opened 5 months ago

herzaso commented 5 months ago

I have this code:

const InnerElementType = forwardRef<HTMLUListElement>(({ ...rest }, ref) => <ul ref={ref} {...rest} />);
...
        <AutoSizer className='h-40 w-full'>
          {({ width, height }: { width: number; height: number }) => (
            <FixedSizeList
              height={height}
              width={width}
              itemSize={56}
              itemCount={items.length}
              innerElementType={InnerElementType}
            >
              Item {items[index]}
            </FixedSizeList>
          )}
      </AutoSizer>

and I don't see any ul in the DOM. Am I doing something wrong? For completeness, this is just a test since what I really want to do is to add a className to the inner component