({
...props
}: ControllerProps<TFieldValues, TName>)
| 18 | const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue); |
| 19 | |
| 20 | const FormField = < |
| 21 | TFieldValues extends FieldValues = FieldValues, |
| 22 | TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, |
| 23 | >({ |
| 24 | ...props |
| 25 | }: ControllerProps<TFieldValues, TName>) => { |
| 26 | return ( |
| 27 | <FormFieldContext.Provider value={{ name: props.name }}> |
| 28 | <Controller {...props} /> |
| 29 | </FormFieldContext.Provider> |
| 30 | ); |
| 31 | }; |
| 32 | |
| 33 | const useFormField = () => { |
| 34 | const fieldContext = React.useContext(FormFieldContext); |
nothing calls this directly
no outgoing calls
no test coverage detected