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) {
|
if (renderSectionHeader) {
|
||||||
bodyComponents.push(React.cloneElement(
|
const element = renderSectionHeader(
|
||||||
renderSectionHeader(
|
dataSource.getSectionHeaderData(sectionIdx),
|
||||||
dataSource.getSectionHeaderData(sectionIdx),
|
sectionID
|
||||||
sectionID
|
);
|
||||||
),
|
if (element) {
|
||||||
{key: 's_' + sectionID},
|
bodyComponents.push(React.cloneElement(element, {key: 's_' + sectionID}));
|
||||||
));
|
if (this.props.stickySectionHeadersEnabled) {
|
||||||
if (this.props.stickySectionHeadersEnabled) {
|
stickySectionHeaderIndices.push(totalIndex);
|
||||||
stickySectionHeaderIndices.push(totalIndex++);
|
}
|
||||||
|
totalIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue