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
For anyone writing function component that can use hook,
import React, { useRef } from 'react'; import { ScrollView } from 'react-native'; const ScreenComponent = (props) => { const scrollViewRef = useRef(); return ( scrollViewRef.current.scrollToEnd({ animated: true })} /> ); };