mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-05 22:47:48 +08:00
Fix an issue (Sticky header index was outside the range) when renderSeparator is defined but returns null
Summary:Fix an issue when using ListView and define `renderSeparator` but the implementation returns null.
In such cases the sectionHeaderIndices mismatch the child element index and the app shows a warning like "Sticky header index 18 was outside the range {0, 13}".
Closes https://github.com/facebook/react-native/pull/5800
Differential Revision: D2980005
Pulled By: vjeux
fb-gh-sync-id: cd2d51d83698ed189bb65ea40b7b073644136b49
shipit-source-id: cd2d51d83698ed189bb65ea40b7b073644136b49
This commit is contained in:
committed by
facebook-github-bot-7
parent
a9846da9fa
commit
c449d9e72d
@@ -394,8 +394,10 @@ var ListView = React.createClass({
|
||||
rowID,
|
||||
adjacentRowHighlighted
|
||||
);
|
||||
bodyComponents.push(separator);
|
||||
totalIndex++;
|
||||
if (separator) {
|
||||
bodyComponents.push(separator);
|
||||
totalIndex++;
|
||||
}
|
||||
}
|
||||
if (++rowCount === this.state.curRenderedRowsCount) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user