Open PsyKoMari opened 6 years ago
yep, same issues, @garetht any idea?
So annoying, it just renders the loader on scroll even though isInfiniteLoading=false and there is no more. Please fix!
Actually all you need is this:
componentDidMount() {
window.addEventListener('scroll', this.onScroll, false)
this.initialLoad()
}
componentWillUnmount() {
window.removeEventListener('scroll', this.onScroll, false)
}
onScroll() {
if (window.innerHeight + window.scrollY >= document.body.offsetHeight - 300) {
this.loadMore()
}
}
I'm not sure if that's a issue btw I wanna report
I'm using this component to render ListItems containing folders data, so I use this to navigate between folders. I request data from the server and build my ListItems with the functions
handleInfiniteLoad()
andbuildElements()
as examples shows. All works perfectly except when I navigate in a empty folder... ThehandleInfiniteLoad()
is called, thebuildElements()
builds 0 items and ok, then I press "UP" to list previous folder, got data from the server, set the new state, but the list remains empty.After some investigation I saw that I've to force call to
handleInfiniteLoad()
after it rendered 0 items to get it working again