You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the Form documentation I should be able to use a <Form.Message> outside of a wrapping <Form.Field> as long as I wire them up explicitly using the name prop.
However, this doesn't work and results in below error when using with NextJS 13.4.10:
- error node_modules/@radix-ui/react-context/dist/index.mjs (55:0) @ useContext- error Error: `FormMessage` must be used within `FormField`null
Expected behavior
I would like to be able to use <Form.Message> outside of a <Form.Field> as mentioned in the docs.
Reproducible example
'use client'import*asFormfrom'@radix-ui/react-form'exportdefaultfunctionSignupEmailComponent(){return(<Form.Root><Form.Messagematch="valueMissing"name={"email"}>
Please enter your email address.
</Form.Message><Form.Messagematch="typeMismatch"name={"email"}>
Please enter a valid email address.
</Form.Message><divclassName="flex gap-2 items-center"><Form.FieldclassName="grow"name="email"><Form.ControlasChild><inputtype="email"className="w-full"placeholder="[email protected]"required/></Form.Control></Form.Field><Form.SubmitasChild><buttonclassName="link-button">Submit</button></Form.Submit></div></Form.Root>)}
Suggested solution
It would be nice to have the component acting as described in the docs.
Your environment
Software
Name(s)
Version
Radix Package(s)
@radix-ui/react-form
^0.0.3
React
n/a
18.2.0
Browser
Arc (Chromium)
114.0.5735.198
Assistive tech
-
-
Node
n/a
18.16.1
npm/yarn
npm
9.5.1
Operating System
MacOS
13.4.1(c)
The text was updated successfully, but these errors were encountered:
Bug report
Current Behavior
According to the Form documentation I should be able to use a
<Form.Message>
outside of a wrapping<Form.Field>
as long as I wire them up explicitly using thename
prop.However, this doesn't work and results in below error when using with NextJS 13.4.10:
Expected behavior
I would like to be able to use
<Form.Message>
outside of a<Form.Field>
as mentioned in the docs.Reproducible example
Suggested solution
It would be nice to have the component acting as described in the docs.
Your environment
The text was updated successfully, but these errors were encountered: