Skip to content

It is not possible to use scrollToEnd for FlatList after adding of new item.  #22854

Description

@Chehow

Description

I need to scroll to the end of FlatList after adding of new list item (like a chat).
So I change state with new message and then use:
this.setState({messages});
this.messagesList.scrollToEnd({animated: true});
It woks only if I add some 'magic' setTimeout (200ms).
It there any way to detect that new message is added and i can call scrollToEnd?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions