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

Function FormMessage

packages/react/src/components/form.tsx:121–140  ·  view source on GitHub ↗
({ className, ...props }: React.ComponentProps<"p">)

Source from the content-addressed store, hash-verified

119}
120
121function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
122 const { error, formMessageId } = useFormField();
123 // oxlint-disable-next-line executor/no-unknown-error-message -- boundary: react-hook-form field errors carry public validation text
124 const body = error ? String(error?.message ?? "") : props.children;
125
126 if (!body) {
127 return null;
128 }
129
130 return (
131 <p
132 data-slot="form-message"
133 id={formMessageId}
134 className={cn("text-sm text-destructive", className)}
135 {...props}
136 >
137 {body}
138 </p>
139 );
140}
141
142export {
143 useFormField,

Callers

nothing calls this directly

Calls 2

cnFunction · 0.90
useFormFieldFunction · 0.85

Tested by

no test coverage detected