diff --git a/Libraries/Lists/SectionList.js b/Libraries/Lists/SectionList.js index 10c26fd143..32fd2c8599 100644 --- a/Libraries/Lists/SectionList.js +++ b/Libraries/Lists/SectionList.js @@ -9,7 +9,6 @@ */ 'use strict'; -const MetroListView = require('MetroListView'); const Platform = require('Platform'); const React = require('React'); const ScrollView = require('ScrollView'); @@ -277,7 +276,9 @@ class SectionList> extends React.PureComponent< viewOffset?: number, viewPosition?: number, }) { - this._wrapperListRef.scrollToLocation(params); + if (this._wrapperListRef != null) { + this._wrapperListRef.scrollToLocation(params); + } } /** @@ -326,18 +327,14 @@ class SectionList> extends React.PureComponent< } render() { - const List = VirtualizedSectionList; /* $FlowFixMe(>=0.66.0 site=react_native_fb) This comment suppresses an * error found when Flow v0.66 was deployed. To see the error delete this * comment and run Flow. */ - return ; + return ; } - _wrapperListRef: MetroListView | VirtualizedSectionList; + _wrapperListRef: ?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._wrapperListRef = ref; }; }