mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-02 10:35:54 +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() {
|
componentDidUpdate() {
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
this._measureAndUpdateScrollProps();
|
this._measureAndUpdateScrollProps();
|
||||||
|
|||||||
Reference in New Issue
Block a user