diff --git a/src/content/learn/react-compiler.md b/src/content/learn/react-compiler.md
index 019d8ed60..2f6a2d3e3 100644
--- a/src/content/learn/react-compiler.md
+++ b/src/content/learn/react-compiler.md
@@ -19,9 +19,13 @@ title: React Compiler
+<<<<<<< HEAD
React Compiler は実験的なコンパイラであり、コミュニティから早期フィードバックを得るためにオープンソース化したものです。まだ粗削りな部分があり、本番環境で使用できる準備は整っていません。
React Compiler の使用には React 19 RC が必要です。React 19 にアップグレードできない場合は、[Working Group](https://github.com/reactwg/react-compiler/discussions/6) で説明されているように、キャッシュ関数に対するユーザスペースの実装を試すことができます。ただしこれは推奨されておらず、可能な限り React 19 にアップグレードするべきです。
+=======
+React Compiler is a new experimental compiler that we've open sourced to get early feedback from the community. It still has rough edges and is not yet fully ready for production.
+>>>>>>> 2b2d0f2309f49c82cf5bb88ea62fb2e44661c634
React Compiler は実験的なコンパイラであり、コミュニティから早期フィードバックを得るためにオープンソース化したものです。これはビルド時のみに実行されるツールであり、あなたの React アプリを自動的に最適化します。プレーンな JavaScript で動作し、[React のルール](/reference/rules)を理解しているため、コードを書き直す必要はありません。
@@ -226,6 +230,29 @@ module.exports = function () {
`babel-plugin-react-compiler` は、他の Babel プラグインより前に、最初に実行される必要があります。コンパイラは、正確な解析のために入力ソース情報を必要とするためです。
+React Compiler works best with React 19 RC. If you are unable to upgrade, you can install the extra `react-compiler-runtime` package which will allow the compiled code to run on versions prior to 19. However, note that the minimum supported version is 17.
+
+
+npm install react-compiler-runtime@experimental
+
+
+You should also add the correct `target` to your compiler config, where `target` is the major version of React you are targeting:
+
+```js {3}
+// babel.config.js
+const ReactCompilerConfig = {
+ target: '18' // '17' | '18' | '19'
+};
+
+module.exports = function () {
+ return {
+ plugins: [
+ ['babel-plugin-react-compiler', ReactCompilerConfig],
+ ],
+ };
+};
+```
+
### Vite {/*usage-with-vite*/}
Vite を使用する場合、vite-plugin-react にプラグインを追加できます。
diff --git a/src/content/reference/react/useActionState.md b/src/content/reference/react/useActionState.md
index 89eff92e6..87ae3b3bf 100644
--- a/src/content/reference/react/useActionState.md
+++ b/src/content/reference/react/useActionState.md
@@ -20,7 +20,7 @@ React Canary の以前のバージョンでは、この API は React DOM の一
`useActionState` は、フォームアクションの結果に基づいて state を更新するためのフックです。
```js
-const [state, formAction] = useActionState(fn, initialState, permalink?);
+const [state, formAction, isPending] = useActionState(fn, initialState, permalink?);
```
@@ -35,7 +35,11 @@ const [state, formAction] = useActionState(fn, initialState, permalink?);
{/* TODO T164397693: link to actions documentation once it exists */}
+<<<<<<< HEAD
コンポーネントのトップレベルで `useActionState` を呼び出してコンポーネントの state を作成し、[フォームアクションが呼び出されたとき](/reference/react-dom/components/form)に更新されるようにします。既存のフォームアクション関数と初期 state を `useActionState` に渡し、フォームで使用する新しいアクションと最新のフォーム state が返されます。あなたが渡した関数にも、最新のフォーム state が渡されるようになります。
+=======
+Call `useActionState` at the top level of your component to create component state that is updated [when a form action is invoked](/reference/react-dom/components/form). You pass `useActionState` an existing form action function as well as an initial state, and it returns a new action that you use in your form, along with the latest form state and whether the Action is still pending. The latest form state is also passed to the function that you provided.
+>>>>>>> 2b2d0f2309f49c82cf5bb88ea62fb2e44661c634
```js
import { useActionState } from "react";
@@ -71,10 +75,18 @@ function StatefulForm({}) {
#### 返り値 {/*returns*/}
+<<<<<<< HEAD
`useActionState` は 2 つの値を含む配列を返します。
1. 現在の state。初回レンダー時には、渡した `initialState` と等しくなります。アクションが呼び出された後は、そのアクションが返した値と等しくなります。
2. フォームコンポーネントの `action` プロパティや、フォーム内の任意の `button` コンポーネントの `formAction` プロパティとして渡すことができる新しいアクション。
+=======
+`useActionState` returns an array with the following values:
+
+1. The current state. During the first render, it will match the `initialState` you have passed. After the action is invoked, it will match the value returned by the action.
+2. A new action that you can pass as the `action` prop to your `form` component or `formAction` prop to any `button` component within the form.
+3. The `isPending` flag that tells you whether there is a pending Transition.
+>>>>>>> 2b2d0f2309f49c82cf5bb88ea62fb2e44661c634
#### 注意点 {/*caveats*/}
@@ -104,10 +116,18 @@ function MyComponent() {
}
```
+<<<<<<< HEAD
`useActionState` は、2 つの項目を含む配列を返します。
1. フォームの state の現在値。初期値はあなたが渡した 初期 state となり、フォームが送信された後はあなたが渡したアクションの返り値となります。
2. `
);
}
@@ -162,6 +182,10 @@ export async function addToCart(prevState, queryData) {
if (itemID === "1") {
return "Added to cart";
} else {
+ // Add a fake delay to make waiting noticeable.
+ await new Promise(resolve => {
+ setTimeout(resolve, 2000);
+ });
return "Couldn't add to cart: the item is sold out.";
}
}