diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index 723bcfa4f18168..4c5e66ae94bd9f 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -490,18 +490,15 @@ const ScrollView = React.createClass({ }, _updateAnimatedNodeAttachment: function() { + if (this._scrollAnimatedValueAttachment) { + this._scrollAnimatedValueAttachment.detach(); + } if (this.props.stickyHeaderIndices && this.props.stickyHeaderIndices.length > 0) { - if (!this._scrollAnimatedValueAttachment) { - this._scrollAnimatedValueAttachment = Animated.attachNativeEvent( - this._scrollViewRef, - 'onScroll', - [{nativeEvent: {contentOffset: {y: this._scrollAnimatedValue}}}] - ); - } - } else { - if (this._scrollAnimatedValueAttachment) { - this._scrollAnimatedValueAttachment.detach(); - } + this._scrollAnimatedValueAttachment = Animated.attachNativeEvent( + this._scrollViewRef, + 'onScroll', + [{nativeEvent: {contentOffset: {y: this._scrollAnimatedValue}}}] + ); } },