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
ScrollView
Here is the simplest solution I could muster:
(this.listView = ref)} onLayout={event => { this.listViewHeight = event.nativeEvent.layout.height; }} onContentSizeChange={() => { this.listView.scrollTo({ y: this.listView.getMetrics().contentLength - this.listViewHeight }); }} />;