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
The "Display a form submission error without JavaScript" section on the form element docs page states the following, among other things:
Displaying a [...] error message [...] requires that:
- <form> be rendered by a Server Component
- [...]
- the useFormState Hook be used to display the error message
Then there's an example on how to do this. However, there are two concerns with the example:
The provided example uses a client component, not a server component, so the <form> element is being rendered in a client component, breaking the first requirement
If we pretend that the client component is used instead of a server component for the demonstration purposes only, the component that renders the <form> element uses the useFormState hook, which is not allowed for server components.
Summary
The "Display a form submission error without JavaScript" section on the form element docs page states the following, among other things:
Then there's an example on how to do this. However, there are two concerns with the example:
<form>
element is being rendered in a client component, breaking the first requirement<form>
element uses theuseFormState
hook, which is not allowed for server components.Page
https://react.dev/reference/react-dom/components/form#display-a-form-submission-error-without-javascript
Details
No response
The text was updated successfully, but these errors were encountered: