MCPcopy Create free account
hub / github.com/react-native-segmented-control/segmented-control / handleChange

Function handleChange

js/SegmentedControl.js:49–59  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

47 const ref = React.useRef();
48
49 const handleChange = (index: number) => {
50 // mocks iOS's nativeEvent
51 const event: any = {
52 nativeEvent: {
53 value: values[index],
54 selectedSegmentIndex: index,
55 },
56 };
57 onChange && onChange(event);
58 onValueChange && onValueChange(values[index]);
59 };
60
61 const updateSegmentWidth = React.useCallback(
62 (width: number) => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…