mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-23 23:06:24 +00:00
committed by
Nicolas Gallagher
parent
32f454de66
commit
04e3c23e67
@@ -59,6 +59,20 @@ class ListView extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps: Object) {
|
||||
if (this.props.dataSource !== nextProps.dataSource || this.props.initialListSize !== nextProps.initialListSize) {
|
||||
this.setState((state, props) => {
|
||||
this._prevRenderedRowsCount = 0;
|
||||
return {
|
||||
curRenderedRowsCount: Math.min(
|
||||
Math.max(state.curRenderedRowsCount, props.initialListSize),
|
||||
props.enableEmptySections ? props.dataSource.getRowAndSectionCount() : props.dataSource.getRowCount()
|
||||
)
|
||||
};
|
||||
}, () => this._renderMoreRowsIfNeeded());
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
requestAnimationFrame(() => {
|
||||
this._measureAndUpdateScrollProps();
|
||||
|
||||
Reference in New Issue
Block a user