Closed sm2017 closed 4 years ago
@lencioni @trotzig Can you please help me
Hi @sm2017! Did you try using a key
prop? It's listed in the usage section in the readme. Something like:
<Waypoint
key={cursor}
onEnter={this._loadMoreContent}
/>
@trotzig it looking awesome , but what is cursor
exactly? If I pass result array as key, it will fetch after invisibility too
Something like this could work:
const [cursor, setCursor] = useState(0);
...
<Waypoint
key={cursor}
onEnter={async () => {
await loadMoreContent();
setCursor(cursor+1);
}
/>
I used
onEnter
andonPositionChange
props to implement an infinite scroll I have a problem withreact-waypoint
, when height of loaded elements is less than Boundary's heightonPositionChange
if not fired again , it fired only with scrolling , so I cannot load next pageIf I make browser window smaller , so Boundary's height is less than height of loaded elements , so by scrolling I fire
onEnter
andonPositionChange
again and next page loaded