VirtualizedList - trigger this.props.onContentSizeChange

Summary:
Have tested this and works fine
```
<SectionList
    onLayout={this.onLayout}
    ref={thisRef => this.listView = thisRef}
    ListFooterComponent={this.renderFooter}
    renderItem={this._renderRow}
    onScroll={this._onScroll}
    onContentSizeChange={this.contentSizeChanged}
    renderSectionHeader={this._renderSectionHeader}
    sections={this.props.data}
/>
Closes https://github.com/facebook/react-native/pull/12708

Differential Revision: D4656338

Pulled By: sahrens

fbshipit-source-id: a2b585aa80247ff0dc2261b740003a6e77cb7a97
This commit is contained in:
David Adams 2017-03-04 19:11:11 -08:00 committed by Facebook Github Bot
parent 6378333b1d
commit e3ef69548c
1 changed files with 3 additions and 0 deletions

View File

@ -539,6 +539,9 @@ class VirtualizedList extends React.PureComponent<OptionalProps, Props, State> {
} }
_onContentSizeChange = (width: number, height: number) => { _onContentSizeChange = (width: number, height: number) => {
if (this.props.onContentSizeChange) {
this.props.onContentSizeChange(width, height);
}
this._scrollMetrics.contentLength = this._selectLength({height, width}); this._scrollMetrics.contentLength = this._selectLength({height, width});
this._updateCellsToRenderBatcher.schedule(); this._updateCellsToRenderBatcher.schedule();
}; };