File tree Expand file tree Collapse file tree 5 files changed +35
-15
lines changed
packages/react-native-gesture-handler Expand file tree Collapse file tree 5 files changed +35
-15
lines changed Original file line number Diff line number Diff line change 1
- jest . mock ( './src/RNGestureHandlerModule' , ( ) => require ( './src/mocks' ) ) ;
1
+ jest . mock ( './src/RNGestureHandlerModule' , ( ) => require ( './src/mocks/mocks' ) ) ;
2
+ jest . mock ( './src/components/GestureButtons' , ( ) => require ( './src/mocks/mocks' ) ) ;
3
+ jest . mock ( './src/components/Pressable/Pressable' , ( ) => require ( './src/mocks/Pressable' ) ) ;
4
+
5
+
2
6
jest . mock ( './lib/commonjs/RNGestureHandlerModule' , ( ) =>
3
- require ( './lib/commonjs/mocks' )
7
+ require ( './lib/commonjs/mocks/mocks ' )
4
8
) ;
9
+ jest . mock ( './lib/commonjs/components/GestureButtons' , ( ) =>
10
+ require ( './lib/commonjs/mocks/mocks' )
11
+ ) ;
12
+ jest . mock ( './lib/commonjs/components/Pressable' , ( ) =>
13
+ require ( './lib/commonjs/mocks/Pressable' )
14
+ ) ;
15
+
16
+
5
17
jest . mock ( './lib/module/RNGestureHandlerModule' , ( ) =>
6
- require ( './lib/module/mocks' )
18
+ require ( './lib/module/mocks/mocks' )
19
+ ) ;
20
+ jest . mock ( './lib/module/components/GestureButtons' , ( ) =>
21
+ require ( './lib/module/mocks/mocks' )
22
+ ) ;
23
+ jest . mock ( './lib/module/components/Pressable' , ( ) =>
24
+ require ( './lib/module/mocks/Pressable' )
7
25
) ;
26
+
Original file line number Diff line number Diff line change 1
- import Mocks from '../mocks' ;
1
+ import Mocks from '../mocks/mocks ' ;
2
2
3
3
export default {
4
4
...Mocks ,
Original file line number Diff line number Diff line change @@ -64,24 +64,28 @@ export interface RawButtonProps
64
64
65
65
/**
66
66
* Used for testing-library compatibility, not passed to the native component.
67
+ * @deprecated test-only props are deprecated and will be removed in the future.
67
68
*/
68
69
// eslint-disable-next-line @typescript-eslint/ban-types
69
70
testOnly_onPress ?: Function | null ;
70
71
71
72
/**
72
73
* Used for testing-library compatibility, not passed to the native component.
74
+ * @deprecated test-only props are deprecated and will be removed in the future.
73
75
*/
74
76
// eslint-disable-next-line @typescript-eslint/ban-types
75
77
testOnly_onPressIn ?: Function | null ;
76
78
77
79
/**
78
80
* Used for testing-library compatibility, not passed to the native component.
81
+ * @deprecated test-only props are deprecated and will be removed in the future.
79
82
*/
80
83
// eslint-disable-next-line @typescript-eslint/ban-types
81
84
testOnly_onPressOut ?: Function | null ;
82
85
83
86
/**
84
87
* Used for testing-library compatibility, not passed to the native component.
88
+ * @deprecated test-only props are deprecated and will be removed in the future.
85
89
*/
86
90
// eslint-disable-next-line @typescript-eslint/ban-types
87
91
testOnly_onLongPress ?: Function | null ;
Original file line number Diff line number Diff line change
1
+ export { Pressable as default } from 'react-native' ;
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ import {
11
11
DrawerLayoutAndroid ,
12
12
View ,
13
13
} from 'react-native' ;
14
- import { State } from './State' ;
15
- import { Directions } from './Directions' ;
14
+ import { State } from '.. /State' ;
15
+ import { Directions } from '.. /Directions' ;
16
16
17
17
const NOOP = ( ) => {
18
18
// Do nothing
@@ -31,14 +31,14 @@ const LongPressGestureHandler = View;
31
31
const PinchGestureHandler = View ;
32
32
const RotationGestureHandler = View ;
33
33
const FlingGestureHandler = View ;
34
- const RawButton = ( { enabled, ...rest } : any ) => (
35
- < TouchableNativeFeedback disabled = { ! enabled } { ...rest } >
34
+ export const RawButton = ( { enabled, ...rest } : any ) => (
35
+ < TouchableNativeFeedback disabled = { enabled === false } { ...rest } >
36
36
< View />
37
37
</ TouchableNativeFeedback >
38
38
) ;
39
- const BaseButton = RawButton ;
40
- const RectButton = RawButton ;
41
- const BorderlessButton = TouchableNativeFeedback ;
39
+ export const BaseButton = RawButton ;
40
+ export const RectButton = RawButton ;
41
+ export const BorderlessButton = TouchableNativeFeedback ;
42
42
43
43
export default {
44
44
TouchableHighlight,
@@ -57,10 +57,6 @@ export default {
57
57
PinchGestureHandler,
58
58
RotationGestureHandler,
59
59
FlingGestureHandler,
60
- RawButton,
61
- BaseButton,
62
- RectButton,
63
- BorderlessButton,
64
60
PanGestureHandler,
65
61
attachGestureHandler,
66
62
createGestureHandler,
You can’t perform that action at this time.
0 commit comments