({
...props
}: ControllerProps<TFieldValues, TName>)
| 26 | const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue); |
| 27 | |
| 28 | const FormField = < |
| 29 | TFieldValues extends FieldValues = FieldValues, |
| 30 | TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, |
| 31 | >({ |
| 32 | ...props |
| 33 | }: ControllerProps<TFieldValues, TName>) => { |
| 34 | return ( |
| 35 | <FormFieldContext.Provider value={{ name: props.name }}> |
| 36 | <Controller {...props} /> |
| 37 | </FormFieldContext.Provider> |
| 38 | ); |
| 39 | }; |
| 40 | |
| 41 | const useFormField = () => { |
| 42 | const fieldContext = React.useContext(FormFieldContext); |
nothing calls this directly
no outgoing calls
no test coverage detected