Skip to content

Accessing the scroll state on UI thread #218

@stevengoldberg

Description

@stevengoldberg

Following up on the issue I described here. @jmeistrich recommended using getState on the list ref, which exposes the scroll offset. However, that won't work for my use case since the touch event needs to be processed in a worklet function.

I've patched it locally by declaring a scrollOffset shared value, updating it when state.scroll is updated, and exposing the shared value on the list ref. This solved the issue for me, but I'm not sure if you want a more comprehensive solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions