Skip to content

Commit 7cdbed0

Browse files
authored
Mention startTransition in useActionState docs (#7448)
1 parent c140d2c commit 7cdbed0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/content/reference/react/useActionState.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ If used with a Server Function, `useActionState` allows the server's response fr
6868
`useActionState` returns an array with the following values:
6969
7070
1. The current state. During the first render, it will match the `initialState` you have passed. After the action is invoked, it will match the value returned by the action.
71-
2. A new action that you can pass as the `action` prop to your `form` component or `formAction` prop to any `button` component within the form.
71+
2. A new action that you can pass as the `action` prop to your `form` component or `formAction` prop to any `button` component within the form. The action can also be called manually within [`startTransition`](/reference/react/startTransition).
7272
3. The `isPending` flag that tells you whether there is a pending Transition.
7373
7474
#### Caveats {/*caveats*/}
@@ -102,8 +102,8 @@ function MyComponent() {
102102
`useActionState` returns an array with the following items:
103103
104104
1. The <CodeStep step={1}>current state</CodeStep> of the form, which is initially set to the <CodeStep step={4}>initial state</CodeStep> you provided, and after the form is submitted is set to the return value of the <CodeStep step={3}>action</CodeStep> you provided.
105-
2. A <CodeStep step={2}>new action</CodeStep> that you pass to `<form>` as its `action` prop.
106-
3. A <CodeStep step={1}>pending state</CodeStep> that you can utilise whilst your action is processing.
105+
2. A <CodeStep step={2}>new action</CodeStep> that you pass to `<form>` as its `action` prop or call manually within `startTransition`.
106+
3. A <CodeStep step={1}>pending state</CodeStep> that you can utilise while your action is processing.
107107
108108
When the form is submitted, the <CodeStep step={3}>action</CodeStep> function that you provided will be called. Its return value will become the new <CodeStep step={1}>current state</CodeStep> of the form.
109109

0 commit comments

Comments
 (0)