回答編集履歴

2

コード修正

2021/06/05 22:27

投稿

hoshi-takanori
hoshi-takanori

スコア7901

test CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  function makeRows(users) {
28
28
 
29
- return users.flatMap(row => [...Array(row.fileCount).keys()].map(idx => ({ row, idx })));
29
+ return users.flatMap(row => row.files.map((_, idx) => ({ row, idx })));
30
30
 
31
31
  }
32
32
 

1

コード修正

2021/06/05 22:27

投稿

hoshi-takanori
hoshi-takanori

スコア7901

test CHANGED
@@ -88,7 +88,7 @@
88
88
 
89
89
  if (rowIdx >= rows.length) { return undefined; }
90
90
 
91
- const { row, idx } = rows[viewCount * (page - 1) + i];
91
+ const { row, idx } = rows[rowIdx];
92
92
 
93
93
  return <Rows key={`${row.id}-${idx}`} row={row} idx={idx} top={i === 0} />;
94
94