MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / FormField

Function FormField

packages/react/src/components/form.tsx:28–39  ·  view source on GitHub ↗
({
  ...props
}: ControllerProps<TFieldValues, TName>)

Source from the content-addressed store, hash-verified

26const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);
27
28const 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
41const useFormField = () => {
42 const fieldContext = React.useContext(FormFieldContext);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected