Open Justicism15 opened 4 years ago
I'm having this problem too, is it from a recent version?
I'm having this problem too, is it from a recent version?
Yes this is from the recent version. I still haven't solve the problem.
Could you show me what you have done in handlePagination
Here is the code for handlePagination function:
handlePagination = () =>{ let currentPagination = this.state.currentPagination + 1 this.setState(prevState =>{ return{ ...prevState, currentPagination : prevState.currentPagination + 1, initialLoad : false, } })
this.props.getSpecificChatThread(this.state.threadId).then((response) => { if (!isNullOrUndefined(response) && API_ERROR_STATUS === response.status) { this.setState({ isErrorModalShow: true }) } else { if(this.props.threadMessages.length > 0){ this.setState({ itemCount : this.props.threadMessages.length, }) } } }) }
<PerfectScrollbar
onYReachEnd={() => this.setState({ nextPage:2 })}
>
and it will setState over and over again
I am using onYReachEnd in the perfect scrollbar but everytime I load the page an error occurs "Maximum update depth exceeded”. I am using it to call the pagination function:
Code: <PerfectScrollbar swipeEasing={true} onYReachEnd={() => console.log("end")} onYReachStart={()=>this.handlePagination()} options={{ wheelSpeed: 1, wheelPropagation: true, minScrollbarLength: 20, }}
....items
Hello! I'm trying to do the same with this onYReachStart.
One question for you about that: how do you set the scrollbar to start at the end always? Mine starts at the start (top) and then goes to the bottom. Because of this behaviour the onReachYStart fires in the first load
Any updates on the issue?
Having the same issue, onYReachEnd is calling the infinity after page load
I am using onYReachEnd in the perfect scrollbar but everytime I load the page an error occurs "Maximum update depth exceeded”. I am using it to call the pagination function:
Code: <PerfectScrollbar swipeEasing={true} onYReachEnd={() => console.log("end")} onYReachStart={()=>this.handlePagination()} options={{ wheelSpeed: 1, wheelPropagation: true, minScrollbarLength: 20, }}