Skip to content

Commit

Permalink
Pass correct function to useOnAccessibilityAction
Browse files Browse the repository at this point in the history
  • Loading branch information
dtun committed Aug 18, 2024
1 parent fa3f488 commit eefc574
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/ControlSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function ControlSlider({
value,
});
let onAccessibilityAction = useOnAccessibilityAction({
setValue,
updateValue,
value,
});

Expand Down Expand Up @@ -64,21 +64,21 @@ export function ControlSlider({
}

function useOnAccessibilityAction({
setValue,
updateValue,
value,
}: {
setValue: (value: number) => void;
updateValue: (value: number) => void;
value: number;
}) {
return useEvent(function (e: AccessibilityActionEvent) {
let actionName = e.nativeEvent.actionName;

switch (actionName) {
case incrementAction.name:
setValue(value + 10);
updateValue(value + 10);
break;
case decrementAction.name:
setValue(value - 10);
updateValue(value - 10);
break;
default:
break;
Expand Down

0 comments on commit eefc574

Please sign in to comment.