MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / FormField

Function FormField

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

Source from the content-addressed store, hash-verified

29)
30
31const FormField = <
32 TFieldValues extends FieldValues = FieldValues,
33 TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
34>({
35 ...props
36}: ControllerProps<TFieldValues, TName>) => {
37 return (
38 <FormFieldContext.Provider value={{ name: props.name }}>
39 <Controller {...props} />
40 </FormFieldContext.Provider>
41 )
42}
43
44const useFormField = () => {
45 const fieldContext = React.useContext(FormFieldContext)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected