Fix unmount crash when using sticky headers

Reviewed By: bvaughn

Differential Revision: D4659436

fbshipit-source-id: c04394681a4f07599f16bae195313e6617419404
This commit is contained in:
Spencer Ahrens 2017-03-06 21:14:45 -08:00 committed by Facebook Github Bot
parent b085215237
commit 7005f54ab5

View File

@ -337,7 +337,7 @@ class VirtualizedList extends React.PureComponent<OptionalProps, Props, State> {
index={ii} index={ii}
item={item} item={item}
key={key} key={key}
onLayout={this._onCellLayout} onCellLayout={this._onCellLayout}
onUnmount={this._onCellUnmount} onUnmount={this._onCellUnmount}
parentProps={this.props} parentProps={this.props}
/> />
@ -689,7 +689,7 @@ class CellRenderer extends React.Component {
cellKey: string, cellKey: string,
index: number, index: number,
item: Item, item: Item,
onLayout: (event: Object, cellKey: string, index: number) => void, onCellLayout: (event: Object, cellKey: string, index: number) => void,
onUnmount: (cellKey: string) => void, onUnmount: (cellKey: string) => void,
parentProps: { parentProps: {
renderItem: renderItemType, renderItem: renderItemType,
@ -701,7 +701,7 @@ class CellRenderer extends React.Component {
}, },
}; };
_onLayout = (e) => { _onLayout = (e) => {
this.props.onLayout(e, this.props.cellKey, this.props.index); this.props.onCellLayout(e, this.props.cellKey, this.props.index);
} }
componentWillUnmount() { componentWillUnmount() {
this.props.onUnmount(this.props.cellKey); this.props.onUnmount(this.props.cellKey);