react-infinite-scroller
react-infinite-scroller copied to clipboard
Cant set height of container
I want set spefici height of element that use infinite scroll
<div style={{border : '1px solid black', maxHeight : 200, overflow : 'auto'}}>
<InfiniteScroll
pageStart={0}
loadMore={this.loadItems.bind(this)}
hasMore={this.state.hasMore}
initialLoad={true}
loader={loader}
useWindow={true}
isReverse={false}
>
<div className="tracks">
{items}
</div>
</InfiniteScroll>
<div ref={(el) => { this.messagesEnd = el; }}></div>
</div>
But when I render that's not load more item.
I recently updated the issue templates on this repo so that I can identify the bugs with this repo.
Please clone your layout and use of react-infinite-scroller by forking this Code Sandbox and linking it here. Doing so will massively expedite getting the bug fixed! 👊
Same issue !
You need to set the scrolling container with getScrollParent
.
Something like
<InfiniteScroll
pageStart={0}
loader={loader}
hasMore={!allCaughtUp}
loadMore={loadMore}
useWindow={false}
getScrollParent={() => document.getElementById('ThePusher')}
>