MCPcopy Index your code
hub / github.com/callstack/react-native-paper / handlePress

Function handlePress

src/components/RadioButton/utils.ts:3–21  ·  view source on GitHub ↗
({
  onPress,
  value,
  onValueChange,
  event,
}: {
  onPress?: (e: GestureResponderEvent) => void;
  value: string;
  onValueChange?: (value: string) => void;
  event: GestureResponderEvent;
})

Source from the content-addressed store, hash-verified

1import type { GestureResponderEvent } from 'react-native';
2
3export const handlePress = ({
4 onPress,
5 value,
6 onValueChange,
7 event,
8}: {
9 onPress?: (e: GestureResponderEvent) => void;
10 value: string;
11 onValueChange?: (value: string) => void;
12 event: GestureResponderEvent;
13}) => {
14 if (onPress && onValueChange) {
15 console.warn(
16 `onPress in the scope of RadioButtonGroup will not be executed, use onValueChange instead`
17 );
18 }
19
20 onValueChange ? onValueChange(value) : onPress?.(event);
21};
22
23export const isChecked = ({
24 value,

Callers 3

RadioButtonItemFunction · 0.90
RadioButtonAndroidFunction · 0.90
RadioButtonIOSFunction · 0.90

Calls 1

onPressFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…