Skip to content

Commit

Permalink
fix(Switch): onClick handler value
Browse files Browse the repository at this point in the history
  • Loading branch information
LamaEats committed Apr 17, 2024
1 parent 91460b3 commit d41697a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/harmony/Switch/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Counter } from '../Counter/Counter';
import classes from './Switch.module.css';

interface SwitchProps extends Omit<React.HTMLAttributes<HTMLInputElement>, 'onChange'> {
onChange?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
onChange?: (event: React.SyntheticEvent<HTMLButtonElement>, active: string) => void;
name?: string;
value?: string;
animated?: boolean;
Expand Down Expand Up @@ -139,7 +139,7 @@ export const Switch: React.FC<PropsWithChildren<SwitchProps>> = ({
(event: React.SyntheticEvent<HTMLButtonElement>, nextActive: string) => {
setActive(nextActive);

onChange?.(event);
onChange?.(event, nextActive);
},
[onChange],
);
Expand Down

0 comments on commit d41697a

Please sign in to comment.