petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.25k stars 301 forks source link

[BUG] only one item rendered, using components #895

Closed wibed closed 1 year ago

wibed commented 1 year ago

https://codesandbox.io/s/sandpack-project-forked-ndgbbu?file=/App.js

only renders one item somehow.

i expected item to wrap around any eventual itemcontent.

psychedelicious commented 1 year ago

You need to add {...props} to the Item component for react-virtuoso to know what to do with it:

const Item = ({ children, ...props }) => {
  return <div {...props}>{children}</div>;
};