mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Revert "Improve Flow Type for ScrollResponder"
This reverts commit 54bf3ae1cf.
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user