1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Use event.target instead of props.checked

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-05-11 16:05:31 +03:00
parent b8e56dfba5
commit a3d5454df2

View File

@ -21,7 +21,7 @@ export function Switch({ children, disabled, onChange, ...props }: SwitchProps)
type="checkbox"
role="switch"
disabled={disabled}
onChange={(event) => onChange?.(!props.checked, event)}
onChange={(event) => onChange?.(event.target.checked, event)}
{...props}
/>
</label>