Skip to content

Commit 938ec2f

Browse files
merging all conflicts
2 parents 74646ec + c3bc5af commit 938ec2f

24 files changed

Lines changed: 820 additions & 23 deletions

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"webpack-bundle-analyzer": "^4.5.0"
101101
},
102102
"engines": {
103-
"node": "^16.8.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0"
103+
"node": ">=16.8.0"
104104
},
105105
"nextBundleAnalysis": {
106106
"budget": null,

‎src/components/Layout/Page.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {useRouter} from 'next/router';
88
import {SidebarNav} from './SidebarNav';
99
import {Footer} from './Footer';
1010
import {Toc} from './Toc';
11-
import SocialBanner from '../SocialBanner';
11+
// import SocialBanner from '../SocialBanner';
1212
import {DocsPageFooter} from 'components/DocsFooter';
1313
import {Seo} from 'components/Seo';
1414
import PageHeading from 'components/PageHeading';
@@ -137,7 +137,7 @@ export function Page({
137137
/>
138138
</Head>
139139
)}
140-
<SocialBanner />
140+
{/*<SocialBanner />*/}
141141
<TopNav
142142
section={section}
143143
routeTree={routeTree}

‎src/components/Layout/TopNav/TopNav.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function NavItem({url, isActive, children}: any) {
125125
<Link
126126
href={url}
127127
className={cn(
128-
'active:scale-95 transition-transform w-full text-center outline-link py-1.5 px-1.5 xs:px-3 sm:px-4 rounded-full capitalize',
128+
'active:scale-95 transition-transform w-full text-center outline-link py-1.5 px-1.5 xs:px-3 sm:px-4 rounded-full capitalize whitespace-nowrap',
129129
!isActive && 'hover:bg-primary/5 hover:dark:bg-primary-dark/5',
130130
isActive &&
131131
'bg-highlight dark:bg-highlight-dark text-link dark:text-link-dark'

‎src/components/PageHeading.tsx‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ function PageHeading({
2222
title,
2323
status,
2424
canary,
25-
description,
2625
tags = [],
2726
breadcrumbs,
2827
}: PageHeadingProps) {
@@ -40,11 +39,6 @@ function PageHeading({
4039
)}
4140
{status ? <em>—{status}</em> : ''}
4241
</H1>
43-
{description && (
44-
<p className="mt-4 mb-6 dark:text-primary-dark text-xl text-primary leading-large">
45-
{description}
46-
</p>
47-
)}
4842
{tags?.length > 0 && (
4943
<div className="mt-4">
5044
{tags.map((tag) => (

‎src/content/blog/2022/03/29/react-v18.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,11 @@ React 18 の strict モードでは、開発時にコンポーネントがマウ
240240
241241
#### useTransition {/*usetransition*/}
242242

243+
<<<<<<< HEAD
243244
`useTransition` と `startTransition` により、一部の更新は緊急性が低いということをマークできるようになります。その他の更新はデフォルトで緊急性が高いものとして扱われます。React は緊急性の高い更新(例えばテキスト入力の更新)が、緊急性の低い更新(例えば検索結果のリストのレンダー)を中断できるようになります。[こちらのドキュメントを参照](/reference/react/useTransition)。
245+
=======
246+
`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).
247+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
244248
245249
#### useDeferredValue {/*usedeferredvalue*/}
246250

‎src/content/blog/2024/04/25/react-19-upgrade-guide.md‎

Lines changed: 123 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
---
2+
<<<<<<< HEAD
23
title: "React 19 Beta アップグレードガイド"
34
author: Ricky Hanlon
45
date: 2024/04/25
56
description: React 19 に追加された改善にはいくつかの破壊的変更が必要ですが、アップグレードをできるだけスムーズに行えるよう努力しているため、ほとんどのアプリには影響が出ないことを予想しています。この投稿では、ライブラリを React 19 Beta にアップグレードする手順をご案内します。
7+
=======
8+
title: "React 19 RC Upgrade Guide"
9+
author: Ricky Hanlon
10+
date: 2024/04/25
11+
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
613
---
714

815
April 25, 2024 by [Ricky Hanlon](https://twitter.com/rickhanlonii)
916

1017
---
1118

19+
<<<<<<< HEAD
1220
<Note>
1321

1422
このベータリリースは、ライブラリが React 19 に備えるためのものです。アプリ開発者は、私たちがライブラリと協力してフィードバックに基づいた修正を行う間、18.3.0 にアップグレードしたうえで、React 19 の安定版をお待ちください。
@@ -21,6 +29,12 @@ April 25, 2024 by [Ricky Hanlon](https://twitter.com/rickhanlonii)
2129
React 19 に追加された改善にはいくつかの破壊的変更が必要ですが、アップグレードをできるだけスムーズに行えるよう努力しているため、ほとんどのアプリには影響が出ないことを予想しています。
2230

2331
アップグレードを容易にするために、本日 React 18.3 も公開します。
32+
=======
33+
34+
<Intro>
35+
36+
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.
37+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
2438
2539
</Intro>
2640

@@ -36,6 +50,7 @@ React 19 にアップグレードする前に、問題点を見つけるため
3650

3751
</Note>
3852

53+
<<<<<<< HEAD
3954
この投稿では、ライブラリを React 19 Beta 版にアップグレードする手順をご案内します。
4055

4156
- [インストール](#installing)
@@ -46,6 +61,19 @@ React 19 にアップグレードする前に、問題点を見つけるため
4661
- [Changelog](#changelog)
4762

4863
React 19 をテストしていただける方は、このアップグレードガイドに従い、遭遇した[問題を報告](https://github.com/facebook/react/issues/new?assignees=&labels=React+19&projects=&template=19.md&title=%5BReact+19%5D)してください。React 19 Beta 版に追加された新機能のリストについては、[React 19 リリースのお知らせ](/blog/2024/04/25/react-19)をご覧ください。
64+
=======
65+
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
4977
5078
---
5179
## インストール {/*installing*/}
@@ -77,26 +105,61 @@ Your app (or one of its dependencies) is using an outdated JSX transform. Update
77105
React と React DOM の最新バージョンをインストールするには以下のようにします。
78106

79107
```bash
80-
npm install react@beta react-dom@beta
108+
npm install react@rc react-dom@rc
81109
```
82110

111+
<<<<<<< HEAD
83112
TypeScript を使用している場合は、型も更新する必要があります。React 19 が安定版としてリリースされた後は、通常通り `@types/react` と `@types/react-dom` から型をインストールできます。ベータ期間中は `package.json` で強制的に別のパッケージを指定することで、新しい型を利用できます。
113+
=======
114+
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`:
115+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
84116
85117
```json
86118
{
87119
"dependencies": {
88-
"@types/react": "npm:types-react@beta",
89-
"@types/react-dom": "npm:types-react-dom@beta"
120+
"@types/react": "npm:types-react@rc",
121+
"@types/react-dom": "npm:types-react-dom@rc"
90122
},
91123
"overrides": {
92-
"@types/react": "npm:types-react@beta",
93-
"@types/react-dom": "npm:types-react-dom@beta"
124+
"@types/react": "npm:types-react@rc",
125+
"@types/react-dom": "npm:types-react-dom@rc"
94126
}
95127
}
96128
```
97129

98130
また、最も一般的な書き換えのための codemod も含まれています。下記の [TypeScript 関連の変更](#typescript-changes)を参照してください。
99131

132+
## Codemods {/*codemods*/}
133+
134+
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`:
150+
- [`replace-reactdom-render`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-reactdom-render)
151+
- [`replace-string-ref`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-string-ref)
152+
- [`replace-act-import`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-act-import)
153+
- [`replace-use-form-state`](https://github.com/reactjs/react-codemod?tab=readme-ov-file#replace-use-form-state)
154+
- [`prop-types-typescript`](TODO)
155+
156+
This does not include the TypeScript changes. See [TypeScript changes](#typescript-changes) below.
157+
158+
</Note>
159+
160+
Changes that include a codemod include the command below.
161+
162+
For a list of all available codemods, see the [`react-codemod` repo](https://github.com/reactjs/react-codemod).
100163

101164
## 破壊的変更 {/*breaking-changes*/}
102165

@@ -127,8 +190,13 @@ const root = createRoot(container, {
127190

128191
### 非推奨化 React API の削除 {/*removed-deprecated-react-apis*/}
129192

193+
<<<<<<< HEAD
130194
#### 廃止:関数コンポーネントの `propTypes` と `defaultProps` {/*removed-proptypes-and-defaultprops*/}
131195
`PropTypes` は [2017 年 4 月 (v15.5.0)](https://legacy.reactjs.org/blog/2017/04/07/react-v15.5.0.html#new-deprecation-warnings) に非推奨化されました。
196+
=======
197+
#### Removed: `propTypes` and `defaultProps` for functions {/*removed-proptypes-and-defaultprops*/}
198+
`PropTypes` were deprecated in [April 2017 (v15.5.0)](https://legacy.reactjs.org/blog/2017/04/07/react-v15.5.0.html#new-deprecation-warnings).
199+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
132200
133201
React 19 では、React パッケージから `propTypes` チェックが削除されており、使用しても無視されるようになります。`propTypes` を使用している場合は、TypeScript または他の型チェックソリューションへの移行をお勧めします。
134202

@@ -158,7 +226,21 @@ function Heading({text = 'Hello, world!'}: Props) {
158226
}
159227
```
160228

229+
<<<<<<< HEAD
161230
#### 廃止:`contextTypes` と `getChildContext` を使用したレガシーコンテクスト {/*removed-removing-legacy-context*/}
231+
=======
232+
<Note>
233+
234+
Codemod `propTypes` to TypeScript with:
235+
236+
```bash
237+
npx codemod@latest react/prop-types-typescript
238+
```
239+
240+
</Note>
241+
242+
#### Removed: Legacy Context using `contextTypes` and `getChildContext` {/*removed-removing-legacy-context*/}
243+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
162244
163245
レガシーコンテクストは [2018 年 10 月 (v16.6.0)](https://legacy.reactjs.org/blog/2018/10/23/react-v-16-6.html) に非推奨化されました。
164246

@@ -253,7 +335,15 @@ class MyComponent extends React.Component {
253335

254336
<Note>
255337

338+
<<<<<<< HEAD
256339
移行を支援するために、文字列 ref を `ref` コールバックに自動的に置き換える [react-codemod](https://github.com/reactjs/react-codemod/#string-refs) を公開する予定です。最新情報や試用については[この PR](https://github.com/reactjs/react-codemod/pull/309) をフォローしてください。
340+
=======
341+
Codemod string refs with `ref` callbacks:
342+
343+
```bash
344+
npx codemod@latest react/19/replace-string-ref
345+
```
346+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
257347
258348
</Note>
259349

@@ -340,7 +430,21 @@ npm install react-shallow-renderer --save-dev
340430

341431
代替手段については、[警告ページ](https://react.dev/warnings/react-dom-test-utils)をご覧ください。
342432

433+
<<<<<<< HEAD
343434
#### 削除:`ReactDOM.render` {/*removed-reactdom-render*/}
435+
=======
436+
<Note>
437+
438+
Codemod `ReactDOMTestUtils.act` to `React.act`:
439+
440+
```bash
441+
npx codemod@latest react/19/replace-act-import
442+
```
443+
444+
</Note>
445+
446+
#### Removed: `ReactDOM.render` {/*removed-reactdom-render*/}
447+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
344448
345449
`ReactDOM.render` は [2022 年 3 月 (v18.0.0)](https://react.dev/blog/2022/03/08/react-18-upgrade-guide) に非推奨化されました。React 19 では `ReactDOM.render` が削除されており、[`ReactDOM.createRoot`](https://react.dev/reference/react-dom/client/createRoot) を使用するよう移行する必要があります。
346450

@@ -355,7 +459,21 @@ const root = createRoot(document.getElementById('root'));
355459
root.render(<App />);
356460
```
357461

462+
<<<<<<< HEAD
358463
#### 削除:`ReactDOM.hydrate` {/*removed-reactdom-hydrate*/}
464+
=======
465+
<Note>
466+
467+
Codemod `ReactDOM.render` to `ReactDOM.createRoot`:
468+
469+
```bash
470+
npx codemod@latest react/19/replace-reactdom-render
471+
```
472+
473+
</Note>
474+
475+
#### Removed: `ReactDOM.hydrate` {/*removed-reactdom-hydrate*/}
476+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
359477
360478
`ReactDOM.hydrate` は [2022 年 3 月 (v18.0.0)](https://react.dev/blog/2022/03/08/react-18-upgrade-guide) に非推奨化されました。React 19 では `ReactDOM.hydrate` が削除されており、[`ReactDOM.hydrateRoot`](https://react.dev/reference/react-dom/client/hydrateRoot) を使用するよう移行する必要があります。
361479

‎src/content/blog/2024/04/25/react-19.md‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
---
2-
title: "React 19 Beta"
2+
title: "React 19 RC"
33
author: The React Team
44
date: 2024/04/25
5+
<<<<<<< HEAD
56
description: React 19 Beta が npm で利用可能になりました! この投稿では React 19 の新機能、およびそれらをどのように採用するかについて概説します。
7+
=======
8+
description: React 19 RC is now available on npm! In this post, we'll give an overview of the new features in React 19, and how you can adopt them.
9+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
610
---
711

812
April 25, 2024 by [The React Team](/community/team)
913

1014
---
1115

16+
<<<<<<< HEAD
1217
<Note>
1318

1419
このベータリリースは、ライブラリが React 19 に備えるためのものです。アプリ開発者は、私たちがライブラリと協力してフィードバックに基づいた修正を行う間、18.3.0 にアップグレードしたうえで、React 19 の安定版をお待ちください。
@@ -22,6 +27,15 @@ npm で React 19 Beta が利用可能になりました!
2227
</Intro>
2328

2429
[React 19 Beta アップグレードガイド](/blog/2024/04/25/react-19-upgrade-guide)では、アプリを React 19 Beta にアップグレードするためのステップバイステップガイドをお示ししました。この投稿では、React 19 の新機能と、それらをどのように採用するかについて概説します。
30+
=======
31+
<Intro>
32+
33+
React 19 RC is now available on npm!
34+
35+
</Intro>
36+
37+
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
2539
2640
- [React 19 の新機能](#whats-new-in-react-19)
2741
- [React 19 の改善点](#improvements-in-react-19)
@@ -111,10 +125,17 @@ function UpdateName({}) {
111125

112126
アクションはあなたの代わりに自動的にデータの送信を管理してくれます。
113127

128+
<<<<<<< HEAD
114129
- **送信中状態**:アクションは送信中状態を提供します。これはリクエストと共に開始され、最終的な state の更新がコミットされると自動的にリセットされます。
115130
- **楽観的更新**:アクションは新しい [`useOptimistic`](#new-feature-optimistic-updates) フックをサポートしており、リクエスト送信中にユーザに対し即時のフィードバックを表示することができます。
116131
- **エラー処理**:アクションはエラー処理を提供するため、リクエストが失敗した場合にエラーバウンダリを表示し、楽観的更新を自動的に元の状態に復元できます。
117132
- **フォーム**:`<form>` 要素は、props である `action` および `formAction` に関数を渡すことをサポートするようになりました。`action` に関数を渡すことでデフォルトでアクションとして扱われ、送信後にフォームを自動的にリセットします。
133+
=======
134+
- **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.
138+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
118139
119140
</Note>
120141

@@ -510,7 +531,11 @@ ref クリーンアップ関数の導入により、`ref` コールバックか
510531

511532
元のコードは `HTMLDivElement` のインスタンスを返していますが、TypeScript はこれがクリーンアップ関数を返すつもりでミスをしたのか、クリーンアップ関数を返したくないのか判断できないのです。
512533

534+
<<<<<<< HEAD
513535
このパターンは [`no-implicit-ref-callback-return`](https://github.com/eps1lon/types-react-codemod/#no-implicit-ref-callback-return) の codemod を用いて修正できます。
536+
=======
537+
You can codemod this pattern with [`no-implicit-ref-callback-return`](https://github.com/eps1lon/types-react-codemod/#no-implicit-ref-callback-return).
538+
>>>>>>> c3bc5affa0e7452e306c785af11798d16b4f6dd4
514539
515540

516541
### `useDeferredValue` の初期値 {/*use-deferred-value-initial-value*/}

0 commit comments

Comments
 (0)