Permalink
Browse files

Fixed ListViewMock unique key error when many sections

Summary:
When ListViews has multiple sections, then rowIDs are required to be unique per section.
However the ListViewMock required rowIDs to be unique per whole list.
This change fixes the limitation of ListViewMock.
Closes #13642

Differential Revision: D5189675

Pulled By: shergin

fbshipit-source-id: 8a4fb68feb74af3307407d6d70f3f6642f50452a
  • Loading branch information...
tszajna0 authored and facebook-github-bot committed Jun 6, 2017
1 parent aeccbd6 commit a3249650d68017ede749d910ba187ba18b52a163
Showing with 2 additions and 1 deletion.
  1. +2 −1 Libraries/Lists/ListView/__mocks__/ListViewMock.js
@@ -32,9 +32,10 @@ class ListViewMock extends React.Component {
const rowIDs = allRowIDs[sectionIdx];
for (let rowIdx = 0; rowIdx < rowIDs.length; rowIdx++) {
const rowID = rowIDs[rowIdx];
// Row IDs are only unique in a section
rows.push(
<StaticRenderer
key={rowID}
key={'section_' + sectionID + '_row_' + rowID}
shouldUpdate={true}
render={this.props.renderRow.bind(
null,

0 comments on commit a324965

Please sign in to comment.