Skip to content

getVisibleRange not binded to react-list #247

@stepan662

Description

@stepan662

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions