Skip to content

[Typo]: Inconsistency in the <form> element docs #6601

Open
@denexapp

Description

@denexapp

Summary

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.

Page

https://react.dev/reference/react-dom/components/form#display-a-form-submission-error-without-javascript

Details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions