Skip to content

Conversation

robingullo
Copy link

Description

In rare cases where the list unmounts just after a scrollToEnd, you get an unhandled TypeError: Cannot read property 'scrollToEnd' of null coming from this line:

setTimeout(function () {
    scrollViewRef.current.scrollToEnd({ animated: animated });
}, 0);

It might be a race condition with the setTimeout.

Reviewers’ hat-rack 🎩

Replacing current!.scrollToEnd with current?.scrollToEnd has no other impact since it's a side effect.

@naqvitalha
Copy link
Collaborator

@robingullo Thanks for catching this! Can you sign the cla? We can then pull this in.

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

Successfully merging this pull request may close these issues.

2 participants