File tree 1 file changed +15
-33
lines changed
packages/react-native-renderer/src 1 file changed +15
-33
lines changed Original file line number Diff line number Diff line change 7
7
* @flow
8
8
*/
9
9
10
- // Module provided by RN:
11
- import { UIManager } from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface' ;
12
-
13
10
const ReactFabricGlobalResponderHandler = {
14
11
onChange : function ( from : any , to : any , blockNativeResponder : boolean ) {
15
- const fromOrTo = from || to ;
16
- const fromOrToStateNode = fromOrTo && fromOrTo . stateNode ;
17
- const isFabric = ! ! (
18
- fromOrToStateNode && fromOrToStateNode . canonical . _internalInstanceHandle
19
- ) ;
20
-
21
- if ( isFabric ) {
22
- if ( from ) {
23
- // equivalent to clearJSResponder
24
- nativeFabricUIManager . setIsJSResponder (
25
- from . stateNode . node ,
26
- false ,
27
- blockNativeResponder || false ,
28
- ) ;
29
- }
12
+ if ( from ) {
13
+ // equivalent to clearJSResponder
14
+ nativeFabricUIManager . setIsJSResponder (
15
+ from . stateNode . node ,
16
+ false ,
17
+ blockNativeResponder || false ,
18
+ ) ;
19
+ }
30
20
31
- if ( to ) {
32
- // equivalent to setJSResponder
33
- nativeFabricUIManager . setIsJSResponder (
34
- to . stateNode . node ,
35
- true ,
36
- blockNativeResponder || false ,
37
- ) ;
38
- }
39
- } else {
40
- if ( to !== null ) {
41
- const tag = to . stateNode . canonical . _nativeTag ;
42
- UIManager . setJSResponder ( tag , blockNativeResponder ) ;
43
- } else {
44
- UIManager . clearJSResponder ( ) ;
45
- }
21
+ if ( to ) {
22
+ // equivalent to setJSResponder
23
+ nativeFabricUIManager . setIsJSResponder (
24
+ to . stateNode . node ,
25
+ true ,
26
+ blockNativeResponder || false ,
27
+ ) ;
46
28
}
47
29
} ,
48
30
} ;
You can’t perform that action at this time.
0 commit comments