Skip to content

Commit b8bd327

Browse files
committed
docs: capitalize Actions in useActionState and useTransition
1 parent 6ec6134 commit b8bd327

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/content/reference/react/useActionState.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function MyCart({initialState}) {
6060
* The `dispatchAction` function has a stable identity, so you will often see it omitted from Effect dependencies, but including it will not cause the Effect to fire. If the linter lets you omit a dependency without errors, it is safe to do. [Learn more about removing Effect dependencies.](/learn/removing-effect-dependencies#move-dynamic-objects-and-functions-inside-your-effect)
6161
* When using the `permalink` option, ensure the same form component is rendered on the destination page (including the same `reducerAction` and `permalink`) so React knows how to pass the state through. Once the page becomes interactive, this parameter has no effect.
6262
* When using Server Functions, `initialState` needs to be [serializable](/reference/rsc/use-server#serializable-parameters-and-return-values) (values like plain objects, arrays, strings, and numbers).
63-
* If `dispatchAction` throws an error, React cancels all queued actions and shows the nearest [Error Boundary](/reference/react/Component#catching-rendering-errors-with-an-error-boundary).
63+
* If `dispatchAction` throws an error, React cancels all queued Actions and shows the nearest [Error Boundary](/reference/react/Component#catching-rendering-errors-with-an-error-boundary).
6464
* If there are multiple ongoing Actions, React batches them together. This is a limitation that may be removed in a future release.
6565
6666
<Note>
@@ -269,7 +269,7 @@ Try clicking "Add Ticket" multiple times. Every time you click, a new `addToCart
269269
270270
We have to wait for the previous result of `addToCartAction` in order to pass the `prevCount` to the next call to `addToCartAction`. That means React has to wait for the previous Action to finish before calling the next Action.
271271
272-
You can typically solve this by [using with useOptimistic](/reference/react/useActionState#using-with-useoptimistic) but for more complex cases you may want to consider [cancelling queued actions](#cancelling-queued-actions) or not using `useActionState`.
272+
You can typically solve this by [using with useOptimistic](/reference/react/useActionState#using-with-useoptimistic) but for more complex cases you may want to consider [cancelling queued Actions](#cancelling-queued-actions) or not using `useActionState`.
273273
274274
</DeepDive>
275275
@@ -1423,7 +1423,7 @@ function action(prevState, formData) {
14231423
14241424
---
14251425
1426-
### My actions are being skipped {/*actions-skipped*/}
1426+
### My Actions are being skipped {/*actions-skipped*/}
14271427
14281428
If you call `dispatchAction` multiple times and some of them don't run, it may be because an earlier `dispatchAction` call threw an error.
14291429

src/content/reference/react/useTransition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ This is a basic example to demonstrate how Actions work, but this example does n
309309

310310
For common use cases, React provides built-in abstractions such as:
311311
- [`useActionState`](/reference/react/useActionState)
312-
- [`<form>` actions](/reference/react-dom/components/form)
312+
- [`<form>` Actions](/reference/react-dom/components/form)
313313
- [Server Functions](/reference/rsc/server-functions)
314314

315315
These solutions handle request ordering for you. When using Transitions to build your own custom hooks or libraries that manage async state transitions, you have greater control over the request ordering, but you must handle it yourself.
@@ -1945,7 +1945,7 @@ export async function updateQuantity(newName) {
19451945
19461946
When clicking multiple times, it's possible for previous requests to finish after later requests. When this happens, React currently has no way to know the intended order. This is because the updates are scheduled asynchronously, and React loses context of the order across the async boundary.
19471947
1948-
This is expected, because Actions within a Transition do not guarantee execution order. For common use cases, React provides higher-level abstractions like [`useActionState`](/reference/react/useActionState) and [`<form>` actions](/reference/react-dom/components/form) that handle ordering for you. For advanced use cases, you'll need to implement your own queuing and abort logic to handle this.
1948+
This is expected, because Actions within a Transition do not guarantee execution order. For common use cases, React provides higher-level abstractions like [`useActionState`](/reference/react/useActionState) and [`<form>` Actions](/reference/react-dom/components/form) that handle ordering for you. For advanced use cases, you'll need to implement your own queuing and abort logic to handle this.
19491949
19501950
19511951
Example of `useActionState` handling execution order:

0 commit comments

Comments
 (0)