1

私は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`.

返されるのは、次のようなオブジェクト (問題?) です。 コンソール出力のイメージ

この問題を解決するにはどうすればよいですか?

4

1 に答える 1