For a chat-like app, I want to keep a ScrollView
component scrolled to the bottom, because newest messages appear under the older ones. Can we adjust the scroll
Actually @Aniruddha answer doesn't worked for me because I'm using "react-native": "0.59.8"
and this.scrollView.root.scrollToEnd
also is undefined
but I figured it out and this works this.scrollView.scrollResponderScrollToEnd({animated: true});
If you are using 0.59.8
this will work OR if you are using later version and this works for you. please add versions in this answer so others wont get trouble.
Full Code here
this.scrollView = ref}
onContentSizeChange={(contentWidth, contentHeight)=>{
this.scrollView.scrollResponderScrollToEnd({animated: true});
}}>