mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook Github Bot
parent
6378333b1d
commit
e3ef69548c
@@ -539,6 +539,9 @@ class VirtualizedList extends React.PureComponent<OptionalProps, Props, State> {
|
||||
}
|
||||
|
||||
_onContentSizeChange = (width: number, height: number) => {
|
||||
if (this.props.onContentSizeChange) {
|
||||
this.props.onContentSizeChange(width, height);
|
||||
}
|
||||
this._scrollMetrics.contentLength = this._selectLength({height, width});
|
||||
this._updateCellsToRenderBatcher.schedule();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user