Skip to content

Commit e3782a6

Browse files
committed
deprecated test-only props
1 parent 1b912ed commit e3782a6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/react-native-gesture-handler/src/components/Pressable/Pressable.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ let IS_FABRIC: null | boolean = null;
4747
const Pressable = (props: PressableProps) => {
4848
const {
4949
ref,
50-
testOnly_pressed,
50+
testOnly_pressed /** @deprecated testOnly props are deprecated and will be removed in the future. **/,
5151
hitSlop,
5252
pressRetentionOffset,
5353
delayHoverIn,
@@ -82,6 +82,9 @@ const Pressable = (props: PressableProps) => {
8282
// used only if `ref` is undefined
8383
const fallbackRef = useRef<View>(null);
8484

85+
/**
86+
* @deprecated testOnly props are deprecated and will be removed in the future.
87+
*/
8588
const [pressedState, setPressedState] = useState(testOnly_pressed ?? false);
8689

8790
const longPressTimeoutRef = useRef<number | null>(null);
@@ -389,6 +392,9 @@ const Pressable = (props: PressableProps) => {
389392
rippleColor={rippleColor}
390393
rippleRadius={android_ripple?.radius ?? undefined}
391394
style={[pointerStyle, styleProp]}
395+
/**
396+
* @deprecated testOnly props are deprecated and will be removed in the future.
397+
*/
392398
testOnly_onPress={IS_TEST_ENV ? onPress : undefined}
393399
testOnly_onPressIn={IS_TEST_ENV ? onPressIn : undefined}
394400
testOnly_onPressOut={IS_TEST_ENV ? onPressOut : undefined}

packages/react-native-gesture-handler/src/components/Pressable/PressableProps.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export interface PressableProps
133133

134134
/**
135135
* Used only for documentation or testing (e.g. snapshot testing).
136+
* @deprecated testOnly props are deprecated and will be removed in the future
136137
*/
137138
testOnly_pressed?: null | boolean;
138139

0 commit comments

Comments
 (0)