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
* Update webpack plugin for webpack 5 ([#22739](https://github.com/facebook/react/pull/22739) by [@michenly](https://github.com/michenly))
340
340
* Fix a mistake in the Node loader. ([#22537](https://github.com/facebook/react/pull/22537) by [@btea](https://github.com/btea))
341
341
* Use `globalThis` instead of `window` for edge environments. ([#22777](https://github.com/facebook/react/pull/22777) by [@huozhi](https://github.com/huozhi))
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/components/form.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -93,11 +93,11 @@ export default function Search() {
93
93
94
94
### Handle form submission with a Server Action {/*handle-form-submission-with-a-server-action*/}
95
95
96
-
Render a `<form>` with an input and submit button. Pass a server action (a function marked with [`'use server'`](/reference/react/use-server)) to the `action` prop of form to run the function when the form is submitted.
96
+
Render a `<form>` with an input and submit button. Pass a Server Action (a function marked with [`'use server'`](/reference/react/use-server)) to the `action` prop of form to run the function when the form is submitted.
97
97
98
-
Passing a server action to `<form action>` allow users to submit forms without JavaScript enabled or before the code has loaded. This is beneficial to users who have a slow connection, device, or have JavaScript disabled and is similar to the way forms work when a URL is passed to the `action` prop.
98
+
Passing a Server Action to `<form action>` allow users to submit forms without JavaScript enabled or before the code has loaded. This is beneficial to users who have a slow connection, device, or have JavaScript disabled and is similar to the way forms work when a URL is passed to the `action` prop.
99
99
100
-
You can use hidden form fields to provide data to the `<form>`'s action. The server action will be called with the hidden form field data as an instance of [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData).
100
+
You can use hidden form fields to provide data to the `<form>`'s action. The Server Action will be called with the hidden form field data as an instance of [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData).
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/hooks/useFormState.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ canary: true
5
5
6
6
<Canary>
7
7
8
-
The `useFormState` Hook is currently only available in React's canary and experimental channels. Learn more about [release channels here](/community/versioning-policy#all-release-channels). In addition, you need to use a framework that supports [React Server Components](/reference/react/use-client) to get the full benefit of `useFormState`.
8
+
The `useFormState` Hook is currently only available in React's Canary and experimental channels. Learn more about [release channels here](/community/versioning-policy#all-release-channels). In addition, you need to use a framework that supports [React Server Components](/reference/react/use-client) to get the full benefit of `useFormState`.
9
9
10
10
</Canary>
11
11
@@ -51,7 +51,7 @@ function StatefulForm({}) {
51
51
52
52
The form state is the value returned by the action when the form was last submitted. If the form has not yet been submitted, it is the initial state that you pass.
53
53
54
-
If used with a server action, `useFormState` allows the server's response from submitting the form to be shown even before hydration has completed.
54
+
If used with a Server Action, `useFormState` allows the server's response from submitting the form to be shown even before hydration has completed.
55
55
56
56
[See more examples below.](#usage)
57
57
@@ -117,7 +117,7 @@ function action(currentState, formData) {
117
117
118
118
#### Display form errors {/*display-form-errors*/}
119
119
120
-
To display messages such as an error message or toast that's returned by a server action, wrap the action in a call to `useFormState`.
120
+
To display messages such as an error message or toast that's returned by a Server Action, wrap the action in a call to `useFormState`.
121
121
122
122
<Sandpack>
123
123
@@ -190,7 +190,7 @@ form button {
190
190
191
191
#### Display structured information after submitting a form {/*display-structured-information-after-submitting-a-form*/}
192
192
193
-
The return value from a server action can be any serializable value. For example, it could be an object that includes a boolean indicating whether the action was successful, an error message, or updated information.
193
+
The return value from a Server Action can be any serializable value. For example, it could be an object that includes a boolean indicating whether the action was successful, an error message, or updated information.
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/hooks/useFormStatus.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ canary: true
5
5
6
6
<Canary>
7
7
8
-
The `useFormStatus` Hook is currently only available in React's canary and experimental channels. Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
8
+
The `useFormStatus` Hook is currently only available in React's Canary and experimental channels. Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
Copy file name to clipboardExpand all lines: src/content/reference/react/useOptimistic.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ canary: true
5
5
6
6
<Canary>
7
7
8
-
The `useOptimistic` Hook is currently only available in React's canary and experimental channels. Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
8
+
The `useOptimistic` Hook is currently only available in React's Canary and experimental channels. Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
9
9
10
10
</Canary>
11
11
@@ -27,7 +27,7 @@ The `useOptimistic` Hook is currently only available in React's canary and exper
27
27
28
28
### `useOptimistic(state, updateFn)` {/*use*/}
29
29
30
-
`useOptimistic` is a React hook that lets you show a different state while an async action is underway. It accepts some state as an argument and returns a copy of that state that can be different during the duration of an async action such as a network request. You provide a function that takes the current state and the input to the action, and returns the optimistic state to be used while the action is pending.
30
+
`useOptimistic` is a React Hook that lets you show a different state while an async action is underway. It accepts some state as an argument and returns a copy of that state that can be different during the duration of an async action such as a network request. You provide a function that takes the current state and the input to the action, and returns the optimistic state to be used while the action is pending.
31
31
32
32
This state is called the "optimistic" state because it is usually used to immediately present the user with the result of performing an action, even though the action actually takes time to complete.
33
33
@@ -116,7 +116,7 @@ export default function App() {
0 commit comments