Rendering takes time, so setTimeout () will work before scrolling to the end. However, you can use the onLayout () method.
export default MyComponent extends React.Component { constructor(props) { super(props) this.scrollToBottom = this.scrollToBottom.bind(this) } scrollToBottom() { this.refs.myView.scrollToEnd() } render() { return { <ListView onLayout={this.scrollToBottom} ref='myView' ... /> } }
Note. ListView is deprecated.
Chanoch
source share