Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ugur-camoglu committed Aug 9, 2021
1 parent 81cb1dd commit f6c2625
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
18 changes: 11 additions & 7 deletions build/react-infinite.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,18 @@ var Infinite = function (_React$Component) {
// this.setState(nextInternalState.newState);
// }

value: function componentDidUpdate(prevProps, prevState, nextProps) {
value: function componentDidUpdate(prevProps, prevState) {
this.loadingSpinnerHeight = this.utils.getLoadingSpinnerHeight();
console.log('xxxx prevProps', prevProps);
console.log('xxxx this.props', this.props);

if (prevProps !== this.props) {
var nextInternalState = this.recomputeInternalStateFromProps(prevProps);
this.computedProps = nextInternalState.computedProps;
this.utils = nextInternalState.utils;
console.log('xxxx this.computedProps', this.computedProps);
this.setState(nextInternalState.newState);
}

if (this.props.displayBottomUpwards) {
this.preservedScrollState = this.utils.getScrollTop() - this.loadingSpinnerHeight;
Expand Down Expand Up @@ -107,12 +117,6 @@ var Infinite = function (_React$Component) {
if (isMissingVisibleRows) {
this.onInfiniteLoad();
}
if (prevProps !== this.props) {
var nextInternalState = this.recomputeInternalStateFromProps(nextProps);
this.computedProps = nextInternalState.computedProps;
this.utils = nextInternalState.utils;
this.setState(nextInternalState.newState);
}
}
}, {
key: 'componentDidMount',
Expand Down
Loading

0 comments on commit f6c2625

Please sign in to comment.