私はreact-window
リストを生成しようとしています。
彼らが使用するデフォルトの行で、彼らは作成します
const Row = ({ index, style }) => (
<div className={index % 2 ? 'ListItemOdd' : 'ListItemEven'} style={style}>
Row {index}
</div>
);
次に、デフォルトの要素を使用して、次のようにリストを作成します
<List
className="List"
height={150}
itemCount={1000}
itemSize={35}
width={300}
>
{Row}
</List>
返されるものもオブジェクトであり、私のものと同じように形成されます
私はほぼ同じことをしようとしています。
List コンポーネントを使用しています
<List
className="List"
height={150}
itemCount={20}
itemSize={35}
width={300}>
{renderUsers(users)}
</List>
出力renderUsers(users)
先const renderUsers = map((user) => <User user={user} key={user.__id} />);
というエラーが表示されます
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Check the render method of `List`.
この問題を解決するにはどうすればよいですか?