Skip to content

Commit 00ecaea

Browse files
authored
SegmentedControl - onChangeIndex should react to changes (#2637)
1 parent 388274b commit 00ecaea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/segmentedControl/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const SegmentedControl = (props: SegmentedControlProps) => {
116116
},
117117
throttleTime,
118118
{trailing: true, leading: false}),
119-
[throttleTime]);
119+
[throttleTime, onChangeIndex]);
120120

121121
useAnimatedReaction(() => {
122122
return animatedSelectedIndex.value;
@@ -126,7 +126,7 @@ const SegmentedControl = (props: SegmentedControlProps) => {
126126
onChangeIndex && runOnJS(changeIndex)();
127127
}
128128
},
129-
[]);
129+
[changeIndex]);
130130

131131
const onSegmentPress = useCallback((index: number) => {
132132
animatedSelectedIndex.value = index;

0 commit comments

Comments
 (0)