chore: update deps, apply updated eslint ocnfig

This commit is contained in:
2023-10-10 16:43:55 +02:00
parent d430ee54e2
commit c6aab409b8
70 changed files with 3131 additions and 3160 deletions

View File

@@ -1,34 +1,34 @@
import { FieldValues, useController, UseControllerProps } from 'react-hook-form'
import { FieldValues, UseControllerProps, useController } from 'react-hook-form'
import { Checkbox, CheckboxProps } from '../../'
export type ControlledCheckboxProps<TFieldValues extends FieldValues> =
UseControllerProps<TFieldValues> & Omit<CheckboxProps, 'onChange' | 'value' | 'id'>
UseControllerProps<TFieldValues> & Omit<CheckboxProps, 'id' | 'onChange' | 'value'>
export const ControlledCheckbox = <TFieldValues extends FieldValues>({
control,
defaultValue,
name,
rules,
shouldUnregister,
control,
defaultValue,
...checkboxProps
}: ControlledCheckboxProps<TFieldValues>) => {
const {
field: { onChange, value },
} = useController({
control,
defaultValue,
name,
rules,
shouldUnregister,
control,
defaultValue,
})
return (
<Checkbox
{...{
onChange,
checked: value,
id: name,
onChange,
...checkboxProps,
}}
/>