diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index 3c209e86513..0476fd9cde0 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -37,7 +37,6 @@ import type { ScrollEvent, LayoutEvent, } from '../../Types/CoreEventTypes'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {State as ScrollResponderState} from '../ScrollResponder'; import type {ViewProps} from '../View/ViewPropTypes'; import type {Props as ScrollViewStickyHeaderProps} from './ScrollViewStickyHeader'; @@ -770,11 +769,15 @@ class ScrollView extends React.Component { return ReactNative.findNodeHandle(this._innerViewRef); } - getInnerViewRef(): ?React.ElementRef> { + getInnerViewRef(): ?React.ElementRef< + Class>, + > { return this._innerViewRef; } - getNativeScrollRef(): ?React.ElementRef> { + getNativeScrollRef(): ?React.ElementRef< + Class>, + > { return this._scrollViewRef; } @@ -947,13 +950,21 @@ class ScrollView extends React.Component { this.props.onContentSizeChange(width, height); }; - _scrollViewRef: ?React.ElementRef> = null; - _setScrollViewRef = (ref: ?React.ElementRef>) => { + _scrollViewRef: ?React.ElementRef< + Class>, + > = null; + _setScrollViewRef = ( + ref: ?React.ElementRef>>, + ) => { this._scrollViewRef = ref; }; - _innerViewRef: ?React.ElementRef> = null; - _setInnerViewRef = (ref: ?React.ElementRef>) => { + _innerViewRef: ?React.ElementRef< + Class>, + > = null; + _setInnerViewRef = ( + ref: ?React.ElementRef>>, + ) => { this._innerViewRef = ref; }; @@ -1057,6 +1068,7 @@ class ScrollView extends React.Component { const contentContainer = ( { // On iOS the RefreshControl is a child of the ScrollView. // tvOS lacks native support for RefreshControl, so don't include it in that case return ( + // $FlowFixMe {Platform.isTV ? null : refreshControl} {contentContainer} @@ -1184,6 +1197,7 @@ class ScrollView extends React.Component { {contentContainer} , @@ -1191,6 +1205,7 @@ class ScrollView extends React.Component { } } return ( + // $FlowFixMe {contentContainer}