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

getVisibleRange not binded to react-list #247

Open
stepan662 opened this issue Sep 10, 2021 · 0 comments
Open

getVisibleRange not binded to react-list #247

stepan662 opened this issue Sep 10, 2021 · 0 comments

Comments

@stepan662
Copy link

When I pass getVisibleRange to other component and use in event handler it throws error:
Snímek obrazovky 2021-09-10 v 10 53 48

It can be fixed by binding it to the reference object first:

<Component
  getVisibleRange={reactListRef.current?.getVisibleRange.bind(reactListRef.current)} />

In child component I'm using it like this:

window.addEventListener('scroll', () => getVisibleRange());

It's quite inconvenient and it took me quite a bit of trying to make it work.

Version 0.8.16

PS: This library is great :)

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

No branches or pull requests

1 participant