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
+3-3Lines changed: 3 additions & 3 deletions
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
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -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/use-client.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -52,14 +52,14 @@ As dependencies of `RichTextEditor`, `formatDate` and `Button` will also be eval
52
52
* When a `'use client'` module is imported from another client-rendered module, the directive has no effect.
53
53
* When a component module contains a `'use client'` directive, any usage of that component is guaranteed to be a Client Component. However, a component can still be evaluated on the client even if it does not have a `'use client'` directive.
54
54
* A component usage is considered a Client Component if it is defined in module with `'use client'` directive or when it is a transitive dependency of a module that contains a `'use client'` directive. Otherwise, it is a Server Component.
55
-
* Code that is marked for client evaluation is not limited to components. All code that is a part of the client module sub-tree is sent to and run by the client.
55
+
* Code that is marked for client evaluation is not limited to components. All code that is a part of the Client module sub-tree is sent to and run by the client.
56
56
* When a server evaluated module imports values from a `'use client'` module, the values must either be a React component or [supported serializable prop values](#passing-props-from-server-to-client-components) to be passed to a Client Component. Any other use case will throw an exception.
57
57
58
58
### How `'use client'` marks client code {/*how-use-client-marks-client-code*/}
59
59
60
60
In a React app, components are often split into separate files, or [modules](/learn/importing-and-exporting-components#exporting-and-importing-a-component).
61
61
62
-
For apps that use React Server Components, the app is server-rendered by default. `'use client'` introduces a server-client boundary in the [module dependency tree](/learn/understanding-your-ui-as-a-tree#the-module-dependency-tree), effectively creating a subtree of client modules.
62
+
For apps that use React Server Components, the app is server-rendered by default. `'use client'` introduces a server-client boundary in the [module dependency tree](/learn/understanding-your-ui-as-a-tree#the-module-dependency-tree), effectively creating a subtree of Client modules.
63
63
64
64
To better illustrate this, consider the following React Server Components app.
65
65
@@ -146,7 +146,7 @@ export default [
146
146
147
147
</Sandpack>
148
148
149
-
In the module dependency tree of this example app, the `'use client'` directive in `InspirationGenerator.js` marks that module and all of its transitive dependencies as client modules. The subtree starting at `InspirationGenerator.js` is now marked as client modules.
149
+
In the module dependency tree of this example app, the `'use client'` directive in `InspirationGenerator.js` marks that module and all of its transitive dependencies as Client modules. The subtree starting at `InspirationGenerator.js` is now marked as Client modules.
150
150
151
151
<Diagramname="use_client_module_dependency"height={250}width={545}alt="A tree graph with the top node representing the module 'App.js'. 'App.js' has three children: 'Copyright.js', 'FancyText.js', and 'InspirationGenerator.js'. 'InspirationGenerator.js' has two children: 'FancyText.js' and 'inspirations.js'. The nodes under and including 'InspirationGenerator.js' have a yellow background color to signify that this sub-graph is client-rendered due to the 'use client' directive in 'InspirationGenerator.js'.">
152
152
`'use client'` segments the module dependency tree of the React Server Components app, marking `InspirationGenerator.js` and all of its dependencies as client-rendered.
@@ -238,7 +238,7 @@ With `'use client'`, you can determine when components are Client Components. As
238
238
For simplicity, we talk about Server Components, but the same principles apply to all code in your app that is server run.
239
239
240
240
#### Advantages of Server Components {/*advantages*/}
241
-
* Server Components can reduce the amount of code sent and run by the client. Only client modules are bundled and evaluated by the client.
241
+
* Server Components can reduce the amount of code sent and run by the client. Only Client modules are bundled and evaluated by the client.
242
242
* Server Components benefit from running on the server. They can access the local filesystem and may experience low latency for data fetches and network requests.
243
243
244
244
#### Limitations of Server Components {/*limitations*/}
@@ -270,7 +270,7 @@ Serializable props include:
270
270
* [TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) and [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)
* Plain [objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object): those created with [object initializers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer), with serializable properties
273
-
* Functions that are [server actions](/reference/react/use-server)
273
+
* Functions that are [Server Actions](/reference/react/use-server)
0 commit comments