diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index bf934b40cbeab0..dc166d41d54aed 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -658,6 +658,18 @@ class ScrollView extends React.Component { this._headerLayoutYs = new Map(); } + UNSAFE_componentWillReceiveProps(nextProps: Props) { + const currentContentInsetTop = this.props.contentInset + ? this.props.contentInset.top + : 0; + const nextContentInsetTop = nextProps.contentInset + ? nextProps.contentInset.top + : 0; + if (currentContentInsetTop !== nextContentInsetTop) { + this._scrollAnimatedValue.setOffset(nextContentInsetTop || 0); + } + } + componentDidMount() { this._updateAnimatedNodeAttachment(); }