mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 09:12:02 +00:00
993f15d2fe
Summary: I encounter issues when using ListView with multiple Sections. ``` ... var ds = new ListView.DataSource({ rowHasChanged : (row1, row2) => row1 !== row2, sectionHeaderHasChanged : (s1, s2) => s1 !== s2 }); ... getInitialState: function() { var sectionIDs = [0,1,2] var rowIDs = [ [0,1,2], [0,1,2], [0,1,2] ] var dataBlob = [ [blob0,blob1,blob2], [blob3,blob4,blob5], [blob6,blob7,blob8], ] return { dataSource : ds.cloneWithRowsAndSections(dataBlob, sectionIDs, rowIDs), }; ``` the code above would throw error because of duplicate key, as ''sectionID0 + rowID0 === sectionID1 + rowID1'. And I have to do: ``` ... sectionIDs.map((id)=>{ return id+''; }); rowIDs.map((sec)=>{ return sec,map((id)=>{ return id+''; }); }); ... ``` ListView with sections does not seem to be documented yet, so I am not sure if this is the intended behaviour or am I missing anything. Co Closes https://github.com/facebook/react-native/pull/4082 Reviewed By: svcscm Differential Revision: D2652028 Pulled By: mkonicek fb-gh-sync-id: a9933bac1a1ae2d6cbc73a11ef6aefde6fcdb35f