feat: add name prop to Checkbox component

This commit is contained in:
Hossein Mehrabi 2023-03-01 14:02:09 +03:30
parent 907dc4b5d0
commit 0e512be105
1 changed files with 3 additions and 1 deletions

View File

@ -12,7 +12,7 @@ export type CheckboxProps = Omit<
> &
Pick<
React.InputHTMLAttributes<HTMLInputElement>,
'onChange' | 'checked' | 'defaultChecked'
'name' | 'onChange' | 'checked' | 'defaultChecked'
> & {
disabled?: boolean
indeterminate?: boolean
@ -23,6 +23,7 @@ export type CheckboxProps = Omit<
export const Checkbox: React.FC<CheckboxProps> & {
classes: typeof checkboxClasses
} = ({
name,
size = 'large',
onChange,
checked,
@ -75,6 +76,7 @@ export const Checkbox: React.FC<CheckboxProps> & {
>
<input
ref={ref}
name={name}
type="checkbox"
disabled={disabled}
checked={input.value}