Use event.target instead of props.checked

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2022-05-11 16:05:31 +03:00
1 parent b8e56dfba5
commit a3d5454df2
1 file changed
+1 -1
+1 -1
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>