Closed ramast closed 8 years ago
Yea this is a very annoying problem and a pretty large barrier to entry for people adopting the library. The issue is that there is a scenario where you wrap <InfiniteScroll />
inside of a div
with a fixed height, making the library work out of the box (which is how I used to use it). That is why I updated the Readme and placed the IMPORTANT text https://github.com/RealScout/redux-infinite-scroll/blob/master/Readme.md#usage. Having said that, I do agree that something needs to change, either a disclaimer higher in the ReadMe, or one of the two solutions you suggested.
Thanks!
Best solution: In the PropTypes, conditionally add isRequired
to ContainerHeight
if elementIsScrollable = true
Yes, I have seen the important part but I thought to myself nah I am using window scrollbar so I don't need to define anything. turns out I am wrong, If I want to use window scrollbar I still need to explicitly define elementIsScrollable
I've been struggling in the past few days with the library calling loadMore function indefinitely on startup and I couldn't figure out the reason.
turns out its because I neither set
elementIsScrollable
norcontainerHeight
. sinceelementIsScrollable
defaults totrue
,containerHeight
is required by default but no errors are reported ifcontainerHeight
wasn't provided.