diff --git a/src/content/blog/2024/04/01/react-19.md b/src/content/blog/2024/04/01/react-19.md
index 15ed69cb8..0741598b2 100644
--- a/src/content/blog/2024/04/01/react-19.md
+++ b/src/content/blog/2024/04/01/react-19.md
@@ -2,16 +2,33 @@
title: "React 19 Beta"
---
-April 1, 2024 by [The React Team](/community/team)
+April 1, 2024, by [The React Team](/community/team)
---
+**TODO**
+- Content
+ - [ ] Finish RSC and RSA sections and examples
+ - [ ] Finish other incomplete sections
+ - [ ] Write Deep Dives
+ - [ ] Review changelog and add any missing sections
+ - [ ] Finish inline todos
+- Polish
+ - [ ] Header capitalization consistency
+ - [ ] React concept capitalization
+ - [ ] Package name capitalization (react-dom vs React DOM)
+ - [ ] Format code with prettier
+
+---
+
React 19 Beta is now available on npm!
In our [React 19 Upgrade Guide](/blog/04/01/react-19-upgrade-guide), we shared step-by-step instructions for upgrading your app to the React 19 Beta. In this post, we'll give an overview of the new features in React 19 Beta, and how you can adopt them.
+
+
_Note for React Native users: React 19 will ship a future version of React Native with the New React Native Architecture._
@@ -28,7 +45,7 @@ For more see [the React Conf website](https://conf.react.dev).
## What's new in React 19 {/*whats-new-in-react-19*/}
-### New Feature: Actions {/*new-feature-actions*/}
+### Actions {/*actions*/}
A common use case in React apps is to perform a data mutation and then update state in response. For example, when a user submits a form to change their name, you will make an API request, and then handle the response. Since this is an async request, you need to handle the pending state in a separate useState call:
@@ -80,20 +97,23 @@ For more information, see the docs for [`useTransition`](/reference/react/useTra
You can always create an Action by dropping down to `useTransition`, but to make the common cases easier we've added a new hook called `useActionState`:
-```js {2,6}
+```js {2,9}
const [name, setName] = useState('');
-const [submitAction, data, isPending] = useActionState(async () => {
- return await updateName(name);
+const [submitAction, state, isPending] = useActionState(async () => {
+ const {error} = await updateName(name);
setName('');
- return result;
+
+ // You can return any result of the action.
+ // Here, we return only the error.
+ return error;
});
```
-`useActionState` accepts an function (the "Action"), and returns a new Action to call. This works because Actions compose. When the new Action is called, `useActionState` will return the last result of the Action as `data`, and the pending state of the Action as `pending`.
+`useActionState` accepts a function (the "Action"), and returns a new Action to call. This works because Actions compose. When the new Action is called, `useActionState` will return the last result of the Action as `data`, and the pending state of the Action as `pending`.
For more information, see the docs for [`useActionState`](/reference/react/useActionState).
-### New Feature: Form Actions {/*new-feature-form-actions*/}
+### Form Actions {/*form-actions*/}
Actions are also integrated with React 19's new Form features. We've added an `action` prop to React DOM `