@@ -22,10 +22,8 @@ const {
22
22
requireNativeComponent,
23
23
} = ReactNative ;
24
24
25
- const AnimatedImplementation = require ( 'react-native/Libraries/Animated/src/AnimatedImplementation' ) ;
26
- const ScrollResponder = require ( 'react-native/Libraries/Components/ScrollResponder' ) ;
25
+ const AnimatedImplementation = require ( 'react-native/Libraries/Animated/AnimatedImplementation' ) ;
27
26
const ScrollViewStickyHeader = require ( 'react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader' ) ;
28
-
29
27
const createReactClass = require ( 'create-react-class' ) ;
30
28
const dismissKeyboard = require ( 'react-native/Libraries/Utilities/dismissKeyboard' ) ;
31
29
const flattenStyle = require ( 'react-native/Libraries/StyleSheet/flattenStyle' ) ;
@@ -34,14 +32,12 @@ const processDecelerationRate = require('react-native/Libraries/Components/Scrol
34
32
const warning = require ( 'fbjs/lib/warning' ) ;
35
33
const resolveAssetSource = require ( 'react-native/Libraries/Image/resolveAssetSource' ) ;
36
34
37
- import type { PressEvent } from 'CoreEventTypes' ;
38
- import type { EdgeInsetsProp } from 'EdgeInsetsPropType' ;
35
+ import type { PressEvent } from 'react-native/Libraries/Types/ CoreEventTypes' ;
36
+ import type { EdgeInsetsProp } from 'react-native/Libraries/StyleSheet/ EdgeInsetsPropType' ;
39
37
import type { NativeMethodsMixinType } from 'ReactNativeTypes' ;
40
- import type { ViewStyleProp } from 'StyleSheet' ;
41
- import type { ViewProps } from 'ViewPropTypes' ;
42
- import type { PointProp } from 'PointPropType' ;
43
-
44
- import type { ColorValue } from 'StyleSheetTypes' ;
38
+ import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet' ;
39
+ import type { PointProp } from 'react-native/Libraries/StyleSheet/PointPropType' ;
40
+ import type { ColorValue } from 'react-native/Libraries/StyleSheet/StyleSheet' ;
45
41
46
42
let AndroidScrollView ;
47
43
let AndroidHorizontalScrollContentView ;
@@ -553,8 +549,8 @@ type State = {|
553
549
| } ;
554
550
function createScrollResponder (
555
551
node : React . ElementRef < typeof ScrollView > ,
556
- ) : typeof ScrollResponder . Mixin {
557
- const scrollResponder = { ...ScrollResponder . Mixin } ;
552
+ ) : typeof View . props . onResponderGrant {
553
+ const scrollResponder = { ...View . props . onResponderGrant } ;
558
554
for ( const key in scrollResponder ) {
559
555
if ( typeof scrollResponder [ key ] === 'function' ) {
560
556
scrollResponder [ key ] = scrollResponder [ key ] . bind ( node ) ;
@@ -611,7 +607,7 @@ class ScrollView extends React.Component<Props, State> {
611
607
* component instance.
612
608
* 3. Continued...
613
609
*/
614
- _scrollResponder : typeof ScrollResponder . Mixin = createScrollResponder ( this ) ;
610
+ _scrollResponder : typeof View . props . onResponderGrant = createScrollResponder ( this ) ;
615
611
constructor ( props : Props ) {
616
612
super ( props ) ;
617
613
/**
@@ -625,13 +621,13 @@ class ScrollView extends React.Component<Props, State> {
625
621
* Since the object returned from that method is the ScrollView instance,
626
622
* we need to bind all mixin methods to the ScrollView instance.
627
623
*/
628
- for ( const key in ScrollResponder . Mixin ) {
624
+ for ( const key in View . props . onResponderGrant ) {
629
625
if (
630
- typeof ScrollResponder . Mixin [ key ] === 'function' &&
626
+ typeof View . props . onResponderGrant [ key ] === 'function' &&
631
627
key . startsWith ( 'scrollResponder' )
632
628
) {
633
629
// $FlowFixMe - dynamically adding properties to a class
634
- ( this : any ) [ key ] = ScrollResponder . Mixin [ key ] . bind ( this ) ;
630
+ ( this : any ) [ key ] = View . props . onResponderGrant [ key ] . bind ( this ) ;
635
631
}
636
632
}
637
633
/**
@@ -640,11 +636,11 @@ class ScrollView extends React.Component<Props, State> {
640
636
* 4. Mixins can initialize properties and use properties on the component
641
637
* instance.
642
638
*/
643
- Object . keys ( ScrollResponder . Mixin )
644
- . filter ( key => typeof ScrollResponder . Mixin [ key ] !== 'function' )
639
+ Object . keys ( View . props . onResponderGrant )
640
+ . filter ( key => typeof View . props . onResponderGrant [ key ] !== 'function' )
645
641
. forEach ( key => {
646
642
// $FlowFixMe - dynamically adding properties to a class
647
- ( this : any ) [ key ] = ScrollResponder . Mixin [ key ] ;
643
+ ( this : any ) [ key ] = View . props . onResponderGrant [ key ] ;
648
644
} ) ;
649
645
}
650
646
@@ -658,7 +654,7 @@ class ScrollView extends React.Component<Props, State> {
658
654
659
655
state = {
660
656
layoutHeight : null ,
661
- ...ScrollResponder . Mixin . scrollResponderMixinGetInitialState ( ) ,
657
+ ...View . props . onResponderGrant . scrollResponderMixinGetInitialState ( ) ,
662
658
} ;
663
659
664
660
UNSAFE_componentWillMount ( ) {
@@ -713,7 +709,7 @@ class ScrollView extends React.Component<Props, State> {
713
709
* to the underlying scroll responder's methods.
714
710
*/
715
711
getScrollResponder ( ) : ScrollResponderType {
716
- // $FlowFixMe - overriding type to include ScrollResponder.Mixin
712
+ // $FlowFixMe - overriding type to include View.props.onResponderGrant
717
713
return ( ( this : any ) : ScrollResponderType ) ;
718
714
}
719
715
0 commit comments