Skip to content

Commit

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


_createClass(Infinite, [{
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: '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: 'componentDidUpdate',
Expand All @@ -89,12 +83,16 @@ var Infinite = function (_React$Component) {
console.log('xxxx prevState.numberOfChildren', prevState.numberOfChildren);
console.log('xxxx this.state.numberOfChildren1', this.state);

if (prevProps !== this.props) {
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.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 (!prevProps.useWindowAsScrollContainer && this.props.useWindowAsScrollContainer) {
Expand Down
Loading

0 comments on commit bbd4b6a

Please sign in to comment.