From 0939b938b2a9beee74f5c44cdef25e0a227efe0d Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Fri, 12 Feb 2021 14:46:34 -0800 Subject: [PATCH] Remove FlowFixMe on ref Summary: Changelog: [Internal][Fixed]:Remove FlowFixMe VirtualizedSectionList ref Reviewed By: nadiia Differential Revision: D26381836 fbshipit-source-id: ed9a687c50a05f1176d99e6e6bd362ac830fbfae --- Libraries/Lists/VirtualizedSectionList.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Libraries/Lists/VirtualizedSectionList.js b/Libraries/Lists/VirtualizedSectionList.js index 216efefc921..89780910f72 100644 --- a/Libraries/Lists/VirtualizedSectionList.js +++ b/Libraries/Lists/VirtualizedSectionList.js @@ -143,8 +143,11 @@ class VirtualizedSectionList< index += this.props.getItemCount(this.props.sections[i].data) + 2; } let viewOffset = params.viewOffset || 0; + if (this._listRef == null) { + return; + } if (params.itemIndex > 0 && this.props.stickySectionHeadersEnabled) { - // $FlowFixMe Cannot access private property + // $FlowFixMe[prop-missing] Cannot access private property const frame = this._listRef._getFrameMetricsApprox( index - params.itemIndex, ); @@ -158,7 +161,7 @@ class VirtualizedSectionList< this._listRef.scrollToIndex(toIndexParams); } - getListRef(): VirtualizedList { + getListRef(): ?React.ElementRef { return this._listRef; } @@ -427,11 +430,8 @@ class VirtualizedSectionList< } _cellRefs = {}; - _listRef: VirtualizedList; + _listRef: ?React.ElementRef; _captureRef = ref => { - /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment - * suppresses an error when upgrading Flow's support for React. To see the - * error delete this comment and run Flow. */ this._listRef = ref; }; }