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
{{ message }}
Repository navigation
Commit 938ec2f
Browse filesBrowse the repository at this point in the historyBrowse files
`useTransition` and `startTransition` let you mark some state updates as not urgent. Other state updates are considered urgent by default. React will allow urgent state updates (for example, updating a text input) to interrupt non-urgent state updates (for example, rendering a list of search results). [See docs here](/reference/react/useTransition).
description: The improvements added to React 19 require some breaking changes, but we've worked to make the upgrade as smooth as possible and we don't expect the changes to impact most apps. In this post, we will guide you through the steps for upgrading apps and libraries to React 19.
12
+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
6
13
---
7
14
8
15
April 25, 2024 by [Ricky Hanlon](https://twitter.com/rickhanlonii)
The improvements added to React 19 RC require some breaking changes, but we've worked to make the upgrade as smooth as possible, and we don't expect the changes to impact most apps.
In this post, we will guide you through the steps for upgrading to React 19:
66
+
67
+
-[Installing](#installing)
68
+
-[Codemods](#codemods)
69
+
-[Breaking changes](#breaking-changes)
70
+
-[New deprecations](#new-deprecations)
71
+
-[Notable changes](#notable-changes)
72
+
-[TypeScript changes](#typescript-changes)
73
+
-[Changelog](#changelog)
74
+
75
+
If you'd like to help us test React 19, follow the steps in this upgrade guide and [report any issues](https://github.com/facebook/react/issues/new?assignees=&labels=React+19&projects=&template=19.md&title=%5BReact+19%5D) you encounter. For a list of new features added to React 19, see the [React 19 release post](/blog/2024/04/25/react-19).
76
+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
49
77
50
78
---
51
79
## インストール {/*installing*/}
@@ -77,26 +105,61 @@ Your app (or one of its dependencies) is using an outdated JSX transform. Update
If you're using TypeScript, you also need to update the types. Once React 19 is released as stable, you can install the types as usual from `@types/react` and `@types/react-dom`. Until the stable release, the types are available in different packages which need to be enforced in your `package.json`:
To help with the upgrade, we've worked with the team at [codemod.com](https://codemod.com) to publish codemods that will automatically update your code to many of the new APIs and patterns in React 19.
135
+
136
+
All codemods are available in the [`react-codemod` repo](https://github.com/reactjs/react-codemod) and the Codemod team have joined in helping maintain the codemods. To run these codemods, we recommend using the `codemod` command instead of the `react-codemod` because it runs faster, handles more complex code migrations, and provides better support for TypeScript.
137
+
138
+
139
+
<Note>
140
+
141
+
#### Run all React 19 codemods {/*run-all-react-19-codemods*/}
142
+
143
+
Run all codemods listed in this guide with the React 19 `codemod` recipe:
144
+
145
+
```bash
146
+
npx codemod@latest react/19/migration-recipe
147
+
```
148
+
149
+
This will run the following codemods from `react-codemod`:
In our [React 19 RC Upgrade Guide](/blog/2024/04/25/react-19-upgrade-guide), we shared step-by-step instructions for upgrading your app to React 19. In this post, we'll give an overview of the new features in React 19, and how you can adopt them.
38
+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
25
39
26
40
-[React 19 の新機能](#whats-new-in-react-19)
27
41
-[React 19 の改善点](#improvements-in-react-19)
@@ -111,10 +125,17 @@ function UpdateName({}) {
111
125
112
126
アクションはあなたの代わりに自動的にデータの送信を管理してくれます。
113
127
128
+
<<<<<<< HEAD
114
129
-**送信中状態**:アクションは送信中状態を提供します。これはリクエストと共に開始され、最終的な state の更新がコミットされると自動的にリセットされます。
-**Pending state**: Actions provide a pending state that starts at the beginning of a request and automatically resets when the final state update is committed.
135
+
-**Optimistic updates**: Actions support the new [`useOptimistic`](#new-hook-optimistic-updates) hook so you can show users instant feedback while the requests are submitting.
136
+
-**Error handling**: Actions provide error handling so you can display Error Boundaries when a request fails, and revert optimistic updates to their original value automatically.
137
+
-**Forms**: `<form>` elements now support passing functions to the `action` and `formAction` props. Passing functions to the `action` props use Actions by default and reset the form automatically after submission.
You can codemod this pattern with [`no-implicit-ref-callback-return`](https://github.com/eps1lon/types-react-codemod/#no-implicit-ref-callback-return).
0 commit comments