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
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/components/form.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -279,7 +279,7 @@ export default function Search() {
279
279
Displaying a form submission error message before the JavaScript bundle loads for progressive enhancement requires that:
280
280
281
281
1.`<form>` be rendered by a [Client Component](/reference/react/use-client)
282
-
1.the function passed to the `<form>`'s `action` prop be a [Server Action](/reference/react/use-server)
282
+
the function passed to the `<form>`'s `action` prop be a [Server Function](/reference/rsc/server-functions)
283
283
1. the `useActionState` Hook be used to display the error message
284
284
285
285
`useActionState` takes two parameters: a [Server Function](/reference/rsc/server-functions) and an initial state. `useActionState` returns two values, a state variable and an action. The action returned by `useActionState` should be passed to the `action` prop of the form. The state variable returned by `useActionState` can be used to display an error message. The value returned by the Server Function passed to `useActionState` will be used to update the state variable.
0 commit comments