Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ugur-camoglu committed Aug 9, 2021
1 parent 99d5ae5 commit 166c956
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 43 deletions.
42 changes: 22 additions & 20 deletions build/react-infinite.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,22 @@ var Infinite = function (_React$Component) {


_createClass(Infinite, [{
key: 'UNSAFE_componentWillReceiveProps',
value: function UNSAFE_componentWillReceiveProps(nextProps) {
var nextInternalState = this.recomputeInternalStateFromProps(nextProps);
console.log('xxxx nextProps', nextProps);

this.computedProps = nextInternalState.computedProps;
this.utils = nextInternalState.utils;
console.log('xxxx computedProps', this.computedProps);
console.log('xxxx utils', this.utils);
this.setState(nextInternalState.newState);
key: 'UNSAFE_componentWillUpdate',

// UNSAFE_componentWillReceiveProps(nextProps: ReactInfiniteProps) {
// var nextInternalState = this.recomputeInternalStateFromProps(nextProps);
// console.log('xxxx nextProps', nextProps);

// this.computedProps = nextInternalState.computedProps;
// this.utils = nextInternalState.utils;
// console.log('xxxx computedProps', this.computedProps);
// console.log('xxxx utils', this.utils);
// this.setState(nextInternalState.newState);
// }
value: function UNSAFE_componentWillUpdate() {
if (this.props.displayBottomUpwards) {
this.preservedScrollState = this.utils.getScrollTop() - this.loadingSpinnerHeight;
}
}
}, {
key: 'componentDidUpdate',
Expand All @@ -83,16 +89,12 @@ var Infinite = function (_React$Component) {
console.log('xxxx prevState.numberOfChildren', prevState.numberOfChildren);
console.log('xxxx this.state.numberOfChildren1', this.state);

// if (this.state.numberOfChildren !== prevState.numberOfChildren) {
// var nextInternalState = this.recomputeInternalStateFromProps(prevProps);
// this.computedProps = nextInternalState.computedProps;
// this.utils = nextInternalState.utils;
// console.log('xxxx this.computedProps1', this.computedProps);
// this.setState(nextInternalState.newState);
// }

if (this.props.displayBottomUpwards) {
this.preservedScrollState = this.utils.getScrollTop() - this.loadingSpinnerHeight;
if (this.state.numberOfChildren !== prevState.numberOfChildren) {
var nextInternalState = this.recomputeInternalStateFromProps(prevProps);
this.computedProps = nextInternalState.computedProps;
this.utils = nextInternalState.utils;
console.log('xxxx this.computedProps1', this.computedProps);
this.setState(nextInternalState.newState);
}

if (!prevProps.useWindowAsScrollContainer && this.props.useWindowAsScrollContainer) {
Expand Down
Loading

0 comments on commit 166c956

Please sign in to comment.