Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
denexapp opened this issue Feb 2, 2024 · 1 comment · May be fixed by #6627
Open

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

denexapp opened this issue Feb 2, 2024 · 1 comment · May be fixed by #6627

Comments

@denexapp
Copy link

denexapp commented Feb 2, 2024

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

@rickhanlonii
Copy link
Member

Yeah this example is borked and we need to fix it, cc @mattcarrollcode

mdj-uk added a commit to mdj-uk/react.dev that referenced this issue Feb 12, 2024
@mdj-uk mdj-uk linked a pull request Feb 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants