Fix crash with empty section headers
Summary: It's ok for them to be empty, so we should check! Reviewed By: yungsters Differential Revision: D4664411 fbshipit-source-id: c66e98458708eee59757fa665b3a05972f1c1b70
This commit is contained in:
parent
7005f54ab5
commit
28b43aa05c
|
@ -430,15 +430,16 @@ var ListView = React.createClass({
|
|||
}
|
||||
|
||||
if (renderSectionHeader) {
|
||||
bodyComponents.push(React.cloneElement(
|
||||
renderSectionHeader(
|
||||
dataSource.getSectionHeaderData(sectionIdx),
|
||||
sectionID
|
||||
),
|
||||
{key: 's_' + sectionID},
|
||||
));
|
||||
if (this.props.stickySectionHeadersEnabled) {
|
||||
stickySectionHeaderIndices.push(totalIndex++);
|
||||
const element = renderSectionHeader(
|
||||
dataSource.getSectionHeaderData(sectionIdx),
|
||||
sectionID
|
||||
);
|
||||
if (element) {
|
||||
bodyComponents.push(React.cloneElement(element, {key: 's_' + sectionID}));
|
||||
if (this.props.stickySectionHeadersEnabled) {
|
||||
stickySectionHeaderIndices.push(totalIndex);
|
||||
}
|
||||
totalIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue