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+
26jest . mock ( './lib/commonjs/RNGestureHandlerModule' , ( ) =>
3- require ( './lib/commonjs/mocks' )
7+ require ( './lib/commonjs/mocks/mocks ' )
48) ;
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+
517jest . 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' )
725) ;
26+
Original file line number Diff line number Diff line change 1- import Mocks from '../mocks' ;
1+ import Mocks from '../mocks/mocks ' ;
22
33export default {
44 ...Mocks ,
Original file line number Diff line number Diff line change @@ -64,24 +64,28 @@ export interface RawButtonProps
6464
6565 /**
6666 * 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.
6768 */
6869 // eslint-disable-next-line @typescript-eslint/ban-types
6970 testOnly_onPress ?: Function | null ;
7071
7172 /**
7273 * 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.
7375 */
7476 // eslint-disable-next-line @typescript-eslint/ban-types
7577 testOnly_onPressIn ?: Function | null ;
7678
7779 /**
7880 * 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.
7982 */
8083 // eslint-disable-next-line @typescript-eslint/ban-types
8184 testOnly_onPressOut ?: Function | null ;
8285
8386 /**
8487 * 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.
8589 */
8690 // eslint-disable-next-line @typescript-eslint/ban-types
8791 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 {
1111 DrawerLayoutAndroid ,
1212 View ,
1313} from 'react-native' ;
14- import { State } from './State' ;
15- import { Directions } from './Directions' ;
14+ import { State } from '.. /State' ;
15+ import { Directions } from '.. /Directions' ;
1616
1717const NOOP = ( ) => {
1818 // Do nothing
@@ -31,14 +31,14 @@ const LongPressGestureHandler = View;
3131const PinchGestureHandler = View ;
3232const RotationGestureHandler = View ;
3333const 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 } >
3636 < View />
3737 </ TouchableNativeFeedback >
3838) ;
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 ;
4242
4343export default {
4444 TouchableHighlight,
@@ -57,10 +57,6 @@ export default {
5757 PinchGestureHandler,
5858 RotationGestureHandler,
5959 FlingGestureHandler,
60- RawButton,
61- BaseButton,
62- RectButton,
63- BorderlessButton,
6460 PanGestureHandler,
6561 attachGestureHandler,
6662 createGestureHandler,
You can’t perform that action at this time.
0 commit comments