Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detachScrollListener in componentDidUpdate #105

Closed
wants to merge 1 commit into from

Conversation

KimSeongIl
Copy link

'react-infinite-scroll' is a good component.
But I think there is an issue.

Call the detachScrollListener function only when 'offset' is less than 'threshold' in the scrollListener function.
So when 'hasMore' changes, the detachScrollListener function is not called.
That's why I think the function detachScrollListener should be called in the componentDidUpdate function as well.

@PierreGUI
Copy link

Relates to issue #44
The fix here works but isn't enough. You shouldn't detach/attach event listener for every update, but only after a change of hasMore.
See dantzchan@506138f (from issue discussion).
Cheers

PierreGUI added a commit to PierreGUI/react-infinite-scroller that referenced this pull request Mar 8, 2018
PierreGUI added a commit to PierreGUI/react-infinite-scroller that referenced this pull request Mar 8, 2018
@KimSeongIl
Copy link
Author

Ok. Thanks for the reply.

@KimSeongIl KimSeongIl closed this Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants