);
}
diff --git a/src/content/learn/react-compiler.md b/src/content/learn/react-compiler.md
index 7fc1680d7..019d8ed60 100644
--- a/src/content/learn/react-compiler.md
+++ b/src/content/learn/react-compiler.md
@@ -121,7 +121,7 @@ React Comiler は多くの React のルールを静的に検証でき、エラ
コンパイラをインストールする前に、まずコードベースが互換性があるかどうかを確認してください。
-npx react-compiler-healthcheck@latest
+npx react-compiler-healthcheck@experimental
このスクリプトは以下をチェックします。
@@ -143,7 +143,7 @@ Found no usage of incompatible libraries.
React Compiler は eslint プラグインも提供しています。eslint プラグインはコンパイラとは**独立して**使用できるため、コンパイラを使用しなくても eslint プラグインだけを使用できます。
-npm install eslint-plugin-react-compiler
+npm install eslint-plugin-react-compiler@experimental
次に、eslint の設定に以下を追加します。
@@ -203,7 +203,7 @@ export default function App() {
### Babel {/*usage-with-babel*/}
-npm install babel-plugin-react-compiler
+npm install babel-plugin-react-compiler@experimental
コンパイラには、ビルドパイプラインでコンパイラを実行するために使用できる Babel プラグインが含まれています。
@@ -258,7 +258,7 @@ Next.js には React Compiler を有効にするための実験的な設定が
- `babel-plugin-react-compiler` をインストールする
-npm install next@canary babel-plugin-react-compiler
+npm install next@canary babel-plugin-react-compiler@experimental
次に以下のようにして `next.config.js` 内で実験的オプションを設定します。
diff --git a/src/content/learn/you-might-not-need-an-effect.md b/src/content/learn/you-might-not-need-an-effect.md
index e174439e5..0fd318566 100644
--- a/src/content/learn/you-might-not-need-an-effect.md
+++ b/src/content/learn/you-might-not-need-an-effect.md
@@ -408,9 +408,15 @@ function Game() {
このコードには 2 つの問題があります。
+<<<<<<< HEAD
1 つ目の問題は、非常に効率が悪いことです。コンポーネント(およびその子)は、連鎖内の各 `set` コールの間で毎回再レンダーする必要があります。上記の例では、最悪の場合、下位のツリーに 3 回の不要な再レンダー(`setCard` → レンダー → `setGoldCardCount` → レンダー → `setRound` → レンダー → `setIsGameOver` → レンダー)が発生することになります。
たとえこれが遅くなかったとしても、コードが発展するにつれ、書いた「チェイン」が新しい要件に適合しないケースが出てきます。例えばゲームの手順を遡る機能を追加しているとしましょう。このためには、各 state 変数を過去のある時点の値に再セットしていくことになります。しかし過去の値から `card` の state をセットした時点で再びエフェクトの連鎖処理がトリガされ、表示されるデータが変更されてしまいます。このようなコードは、硬直的で壊れやすいものです。
+=======
+First problem is that it is very inefficient: the component (and its children) have to re-render between each `set` call in the chain. In the example above, in the worst case (`setCard` → render → `setGoldCardCount` → render → `setRound` → render → `setIsGameOver` → render) there are three unnecessary re-renders of the tree below.
+
+The second problem is that even if it weren't slow, as your code evolves, you will run into cases where the "chain" you wrote doesn't fit the new requirements. Imagine you are adding a way to step through the history of the game moves. You'd do it by updating each state variable to a value from the past. However, setting the `card` state to a value from the past would trigger the Effect chain again and change the data you're showing. Such code is often rigid and fragile.
+>>>>>>> 9aa2e3668da290f92f8997a25f28bd3f58b2a26d
このような場合、レンダー中に計算できるものはそこで行い、イベントハンドラで state の調整を終わらせる方が良いでしょう。
diff --git a/src/content/reference/react-dom/components/index.md b/src/content/reference/react-dom/components/index.md
index 5429a3473..2a3579023 100644
--- a/src/content/reference/react-dom/components/index.md
+++ b/src/content/reference/react-dom/components/index.md
@@ -34,7 +34,11 @@ React は、ブラウザ組み込みのすべての [HTML](https://developer.moz
## リソース・メタデータ関連コンポーネント {/*resource-and-metadata-components*/}
+<<<<<<< HEAD
以下のブラウザ組み込みコンポーネントを用いて、外部リソースを読み込んだり、ドキュメントにメタデータを付与したりすることができます。
+=======
+These built-in browser components let you load external resources or annotate the document with metadata:
+>>>>>>> 9aa2e3668da290f92f8997a25f28bd3f58b2a26d
* [``](/reference/react-dom/components/link)
* [``](/reference/react-dom/components/meta)
diff --git a/src/content/reference/react/cache.md b/src/content/reference/react/cache.md
index 68a44eb53..dc22f8d11 100644
--- a/src/content/reference/react/cache.md
+++ b/src/content/reference/react/cache.md
@@ -226,7 +226,7 @@ async function AnimatedWeatherCard({city}) {
```jsx [[2, 6, "await getUser(id)"], [1, 17, "getUser(id)"]]
const getUser = cache(async (id) => {
return await db.user.query(id);
-})
+});
async function Profile({id}) {
const user = await getUser(id);
@@ -327,7 +327,7 @@ React がメモ化された関数に対してキャッシュアクセスを提
'use client';
function WeatherReport({record}) {
- const avgTemp = useMemo(() => calculateAvg(record)), record);
+ const avgTemp = useMemo(() => calculateAvg(record), record);
// ...
}
diff --git a/src/content/reference/react/index.md b/src/content/reference/react/index.md
index f1708c84d..d89baba4a 100644
--- a/src/content/reference/react/index.md
+++ b/src/content/reference/react/index.md
@@ -14,10 +14,17 @@ React リファレンスは機能別にいくつかのサブセクションに
プログラムから利用する React の機能です。
+<<<<<<< HEAD
* [フック](/reference/react/hooks) - コンポーネント内から使用する様々な React の機能
* [コンポーネント](/reference/react/components) - JSX 内で用いる組み込みコンポーネント
* [API](/reference/react/apis) - コンポーネントの定義に用いる API
* [ディレクティブ](/reference/rsc/directives) - React Server Components 互換のバンドラに与えるための指示情報
+=======
+* [Hooks](/reference/react/hooks) - Use different React features from your components.
+* [Components](/reference/react/components) - Built-in components that you can use in your JSX.
+* [APIs](/reference/react/apis) - APIs that are useful for defining components.
+* [Directives](/reference/rsc/directives) - Provide instructions to bundlers compatible with React Server Components.
+>>>>>>> 9aa2e3668da290f92f8997a25f28bd3f58b2a26d
## React DOM {/*react-dom*/}
diff --git a/src/content/reference/react/lazy.md b/src/content/reference/react/lazy.md
index 0a7f91408..c75f3a4c5 100644
--- a/src/content/reference/react/lazy.md
+++ b/src/content/reference/react/lazy.md
@@ -78,7 +78,7 @@ const MarkdownPreview = lazy(() => import('./MarkdownPreview.js'));
}>
Preview
-
+
```
この例では、`MarkdownPreview` のコードはレンダーしようとするまで読み込まれません。もし `MarkdownPreview` がまだ読み込まれていない場合、その代わりに `Loading` が表示されます。チェックボックスをオンにしてみてください。
diff --git a/src/content/reference/react/useLayoutEffect.md b/src/content/reference/react/useLayoutEffect.md
index 1911b779d..f9e1b2ea3 100644
--- a/src/content/reference/react/useLayoutEffect.md
+++ b/src/content/reference/react/useLayoutEffect.md
@@ -67,6 +67,8 @@ function Tooltip() {
* `useLayoutEffect` 内のコードと、そこでスケジュールされたすべての state 更新は、**ブラウザによる画面の再描画をブロックします**。過度に使用すると、アプリが遅くなります。可能な限り [`useEffect` を使用してください](/reference/react/useEffect)。
+* If you trigger a state update inside `useLayoutEffect`, React will execute all remaining Effects immediately including `useEffect`.
+
---
## 使用法 {/*usage*/}
diff --git a/src/content/reference/react/useSyncExternalStore.md b/src/content/reference/react/useSyncExternalStore.md
index b548ee002..5e46b6324 100644
--- a/src/content/reference/react/useSyncExternalStore.md
+++ b/src/content/reference/react/useSyncExternalStore.md
@@ -41,7 +41,11 @@ function TodosApp() {
#### 引数 {/*parameters*/}
+<<<<<<< HEAD
* `subscribe`: ストアにサブスクライブを開始し、また callback 引数を受け取る関数。ストアが変更された際に渡された callback を呼び出す必要があります。これにより、コンポーネントが再レンダーされます。`subscribe` 関数は、サブスクリプションをクリーンアップする関数を返す必要があります。
+=======
+* `subscribe`: A function that takes a single `callback` argument and subscribes it to the store. When the store changes, it should invoke the provided `callback`, which will cause React to re-call `getSnapshot` and (if needed) re-render the component. The `subscribe` function should return a function that cleans up the subscription.
+>>>>>>> 9aa2e3668da290f92f8997a25f28bd3f58b2a26d
* `getSnapshot`: コンポーネントが必要とするストアにあるデータのスナップショットを返す関数。ストアが変更されていない場合、`getSnapshot` への再呼び出しは同じ値を返す必要があります。ストアが変更されて返された値が([`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) で比較して)異なる場合、React はコンポーネントを再レンダーします。
diff --git a/vercel.json b/vercel.json
index eac0efb9c..8b0546e37 100644
--- a/vercel.json
+++ b/vercel.json
@@ -24,6 +24,11 @@
"destination": "/learn/rendering-lists#keeping-list-items-in-order-with-key",
"permanent": false
},
+ {
+ "source": "/docs/lists-and-keys",
+ "destination": "/learn/rendering-lists#keeping-list-items-in-order-with-key",
+ "permanent": false
+ },
{
"source": "/link/invalid-hook-call",
"destination": "/warnings/invalid-hook-call-warning",