Revert "Improve Flow Type for ScrollResponder"

This reverts commit 54bf3ae1cf.
This commit is contained in:
grabbou
2019-10-29 11:40:52 +01:00
parent 43593c7c0e
commit 18cfb3162c
4 changed files with 4 additions and 21 deletions
+1 -15
View File
@@ -64,21 +64,7 @@ if (Platform.OS === 'android') {
}
export type ScrollResponderType = {
// We'd like to do ...ScrollView here, however Flow doesn't seem
// to see the imperative methods of ScrollView that way. Workaround the
// issue by specifying them manually.
getScrollableNode: $PropertyType<ScrollView, 'getScrollableNode'>,
getInnerViewNode: $PropertyType<ScrollView, 'getInnerViewNode'>,
getNativeScrollRef: $PropertyType<ScrollView, 'getNativeScrollRef'>,
setNativeProps: $PropertyType<ScrollView, 'setNativeProps'>,
scrollTo: $PropertyType<ScrollView, 'scrollTo'>,
scrollWithoutAnimationTo: $PropertyType<
ScrollView,
'scrollWithoutAnimationTo',
>,
flashScrollIndicators: $PropertyType<ScrollView, 'flashScrollIndicators'>,
...ScrollView,
...typeof ScrollResponder.Mixin,
};
+1 -2
View File
@@ -18,7 +18,6 @@ const StyleSheet = require('../StyleSheet/StyleSheet');
const invariant = require('invariant');
import type {ScrollResponderType} from '../Components/ScrollView/ScrollView';
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
import type {
ViewabilityConfig,
@@ -442,7 +441,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
/**
* Provides a handle to the underlying scroll responder.
*/
getScrollResponder(): ?ScrollResponderType {
getScrollResponder(): any {
if (this._listRef) {
return this._listRef.getScrollResponder();
}
+1 -2
View File
@@ -14,7 +14,6 @@ const React = require('react');
const ScrollView = require('../Components/ScrollView/ScrollView');
const VirtualizedSectionList = require('./VirtualizedSectionList');
import type {ScrollResponderType} from '../Components/ScrollView/ScrollView';
import type {ViewToken} from './ViewabilityHelper';
import type {
SectionBase as _SectionBase,
@@ -276,7 +275,7 @@ class SectionList<SectionT: SectionBase<any>> extends React.PureComponent<
/**
* Provides a handle to the underlying scroll responder.
*/
getScrollResponder(): ?ScrollResponderType {
getScrollResponder(): ?ScrollView {
const listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
if (listRef) {
return listRef.getScrollResponder();
+1 -2
View File
@@ -27,7 +27,6 @@ const warning = require('fbjs/lib/warning');
const {computeWindowedRenderLimits} = require('./VirtualizeUtils');
import type {ScrollResponderType} from '../Components/ScrollView/ScrollView';
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
import type {
ViewabilityConfig,
@@ -432,7 +431,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
* Note that `this._scrollRef` might not be a `ScrollView`, so we
* need to check that it responds to `getScrollResponder` before calling it.
*/
getScrollResponder(): ?ScrollResponderType {
getScrollResponder(): any {
if (this._scrollRef && this._scrollRef.getScrollResponder) {
return this._scrollRef.getScrollResponder();
}