diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index a5f17fe18890bb..155bc3444e5837 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -719,6 +719,13 @@ class ScrollView extends React.Component { static Context: typeof ScrollViewContext = ScrollViewContext; constructor(props: Props) { super(props); + + this._scrollAnimatedValue = new AnimatedImplementation.Value( + this.props.contentOffset?.y ?? 0, + ); + this._scrollAnimatedValue.setOffset(this.props.contentInset?.top ?? 0); + this._stickyHeaderRefs = new Map(); + this._headerLayoutYs = new Map(); } _scrollAnimatedValue: AnimatedImplementation.Value = new AnimatedImplementation.Value( @@ -789,13 +796,6 @@ class ScrollView extends React.Component { this.scrollResponderKeyboardDidHide, ); - this._scrollAnimatedValue = new AnimatedImplementation.Value( - this.props.contentOffset?.y ?? 0, - ); - this._scrollAnimatedValue.setOffset(this.props.contentInset?.top ?? 0); - this._stickyHeaderRefs = new Map(); - this._headerLayoutYs = new Map(); - this._updateAnimatedNodeAttachment(); }