MCPcopy Create free account
hub / github.com/Thanas-R/Virdis / FormField

Function FormField

src/components/ui/form.tsx:20–31  ·  view source on GitHub ↗
({
  ...props
}: ControllerProps<TFieldValues, TName>)

Source from the content-addressed store, hash-verified

18const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);
19
20const 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
33const useFormField = () => {
34 const fieldContext = React.useContext(FormFieldContext);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected