From 6355ddee3653afac15bd30aec79ac7bb6e939c4e Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 20 Aug 2021 05:07:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Move=20`Checkbox`=20`value`=20to?= =?UTF-8?q?=20the=20first=20argument?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/inputs/Checkbox.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/inputs/Checkbox.tsx b/src/components/inputs/Checkbox.tsx index 1ca93a5..72ef213 100644 --- a/src/components/inputs/Checkbox.tsx +++ b/src/components/inputs/Checkbox.tsx @@ -8,7 +8,7 @@ import mergeClassNames from "classnames" interface CheckboxProps { disabled?: boolean, - onChange?: (checked: boolean, value: string) => boolean, + onChange?: (value: string, checked: boolean) => boolean, name: string, value: string, @@ -27,7 +27,7 @@ export function Checkbox({onChange, ...props}: CheckboxProps): JSX.Element { const value = event.target.value if(onChange) { - return onChange(checked, value) + return onChange(value, checked) } return false