Skip to content

Commit 08dceff

Browse files
authored
Clarify wording
1 parent 492e403 commit 08dceff

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/content/reference/rsc/server-functions.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ function EmptyNote() {
5656

5757
When React renders the `EmptyNote` Server Component, it will create a reference to the `createNoteAction` function, and pass that reference to the `Button` Client Component. When the button is clicked, React will send a request to the server to execute the `createNoteAction` function with the reference provided:
5858

59-
```js {4}
59+
```js {5}
6060
"use client";
6161

6262
export default function Button({onClick}) {
63+
console.log(onClick);
64+
// {$$typeof: Symbol.for("react.server.reference"), $$id: 'createNoteAction'}
6365
return <button onClick={() => onClick()}>Create Empty Note</button>;
6466
}
6567
```
@@ -183,7 +185,7 @@ function UpdateName() {
183185
}
184186
```
185187

186-
When the Form submission succeeds, React will automatically reset the uncontrolled fields in the form. Server Function forms can be submitted before the JavaScript bundle loads. You can add `useActionState` to access the pending state and last response.
188+
When the Form Action completes, React will automatically reset the uncontrolled fields in the form. Server Function forms can be submitted before the JavaScript bundle loads. You can add `useActionState` to access the pending state and last response.
187189

188190
For more, see the docs for [Server Functions in Forms](/reference/rsc/use-server#server-functions-in-forms).
189191

@@ -247,6 +249,6 @@ function UpdateName() {
247249
}
248250
```
249251

250-
When the <CodeStep step={2}>permalink</CodeStep> is provided to `useActionState`, the browser will navigate to the provided URL if the form is submitted before the JavaScript bundle loads. The same form component, including the same Server Function and permalink, must be rendered at the destination so React can pass the returned state to it.
252+
When the <CodeStep step={2}>permalink</CodeStep> is provided to `useActionState`, the browser will navigate to the provided URL if the form is submitted before the JavaScript bundle loads. At the destination, render `useActionState` with the same Server Function and permalink so React can pass the returned state to it.
251253

252254
For more, see the docs for [`useActionState`](/reference/react/useActionState).

0 commit comments

Comments
 (0)