Support sticky ListHeaderComponent

Summary: Fixed the little oversight.

Reviewed By: TheSavior

Differential Revision: D5743857

fbshipit-source-id: c61a6c29b5f547f3e5a2b7ff2d318f693cc9aed5
This commit is contained in:
Spencer Ahrens 2017-09-01 11:52:03 -07:00 committed by Facebook Github Bot
parent 91c52af083
commit 57c7324ab7

View File

@ -565,6 +565,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
const stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices); const stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices);
const stickyHeaderIndices = []; const stickyHeaderIndices = [];
if (ListHeaderComponent) { if (ListHeaderComponent) {
if (stickyIndicesFromProps.has(0)) {
stickyHeaderIndices.push(0);
}
const element = React.isValidElement(ListHeaderComponent) const element = React.isValidElement(ListHeaderComponent)
? ListHeaderComponent // $FlowFixMe ? ListHeaderComponent // $FlowFixMe
: <ListHeaderComponent />; : <ListHeaderComponent />;