mirror of
https://github.com/ershisan99/flashcards-example-project.git
synced 2025-12-18 05:09:23 +00:00
chore: update deps, apply updated eslint ocnfig
This commit is contained in:
@@ -3,9 +3,9 @@ import { Control, FieldPath, FieldValues, useController } from 'react-hook-form'
|
||||
import { TextField, TextFieldProps } from '@/components'
|
||||
|
||||
export type ControlledTextFieldProps<TFieldValues extends FieldValues> = {
|
||||
name: FieldPath<TFieldValues>
|
||||
control: Control<TFieldValues>
|
||||
} & Omit<TextFieldProps, 'onChange' | 'value' | 'id'>
|
||||
name: FieldPath<TFieldValues>
|
||||
} & Omit<TextFieldProps, 'id' | 'onChange' | 'value'>
|
||||
|
||||
export const ControlledTextField = <TFieldValues extends FieldValues>(
|
||||
props: ControlledTextFieldProps<TFieldValues>
|
||||
@@ -14,8 +14,8 @@ export const ControlledTextField = <TFieldValues extends FieldValues>(
|
||||
field,
|
||||
fieldState: { error },
|
||||
} = useController({
|
||||
name: props.name,
|
||||
control: props.control,
|
||||
name: props.name,
|
||||
})
|
||||
|
||||
return <TextField {...props} {...field} errorMessage={error?.message} id={props.name} />
|
||||
|
||||
Reference in New Issue
Block a user