[fix] ListView section error when missing renderHeader

Close #1174
This commit is contained in:
Julian Hundeloh
2018-11-14 14:25:38 +01:00
committed by Nicolas Gallagher
parent ec6458c09d
commit 6d92cc5ec3

View File

@@ -167,7 +167,7 @@ const ScrollView = createReactClass({
const children =
!horizontal && Array.isArray(stickyHeaderIndices)
? React.Children.map(this.props.children, (child, i) => {
if (stickyHeaderIndices.indexOf(i) > -1) {
if (child && stickyHeaderIndices.indexOf(i) > -1) {
return React.cloneElement(child, { style: [child.props.style, styles.stickyHeader] });
} else {
return child;