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
While Server Actions in React 19 are stable and will not break between major versions, the underlying APIs used to implement Server Actions in a React Server Components bundler or framework do not follow semver and may break between minors in React 19.x.
18
+
React 19 のサーバアクションは安定しており、マイナーバージョン間での破壊的変更はありませんが、サーバコンポーネントのバンドラやフレームワーク内でサーバアクションを実装するために使用される、基盤となる API は semver に従いません。React 19.x のマイナーバージョン間で変更が生じる可能性があります。
19
19
20
-
To support Server Actions as a bundler or framework, we recommend pinning to a specific React version, or using the Canary release. We will continue working with bundlers and frameworks to stabilize the APIs used to implement Server Actions in the future.
20
+
サーバアクションをバンドラやフレームワークでサポートする場合は、特定の React バージョンに固定するか、Canary リリースを使用することをお勧めします。サーバアクションを実装するために使用される API を安定化させるため、今後もバンドラやフレームワークと連携を続けていきます。
21
21
22
22
</Note>
23
23
24
-
When a Server Action is defined with the `"use server"`directive, your framework will automatically create a reference to the server function, and pass that reference to the Client Component. When that function is called on the client, React will send a request to the server to execute the function, and return the result.
When React renders the `EmptyNote`Server Component, it will create a reference to the `createNoteAction`function, and pass that reference to the `Button`Client Component. When the button is clicked, React will send a request to the server to execute the `createNoteAction`function with the reference provided:
@@ -73,7 +73,7 @@ export async function createNoteAction() {
73
73
74
74
```
75
75
76
-
When the bundler builds the `EmptyNote`Client Component, it will create a reference to the `createNoteAction`function in the bundle. When the `button`is clicked, React will send a request to the server to execute the `createNoteAction`function using the reference provided:
When the Form submission succeeds, React will automatically reset the form. You can add `useActionState`to access the pending state, last response, or to support progressive enhancement.
162
+
フォームの送信が成功すると、React は自動的にフォームをリセットします。`useActionState`を追加して、進行中 (pending) state や最終的なレスポンスにアクセスしたり、プログレッシブエンハンスメント (progressive enhancement) をサポートしたりすることが可能です。
163
163
164
-
For more, see the docs for [Server Actions in Forms](/reference/rsc/use-server#server-actions-in-forms).
You can compose Server Actions with `useActionState`for the common case where you just need access to the action pending state and last returned response:
168
+
`useActionState`とサーバアクションを組み合わせることで、アクションの進行中 state と最後に返されたレスポンスにアクセスする、という一般的なユースケースに対応できます。
When using `useActionState`with Server Actions, React will also automatically replay form submissions entered before hydration finishes. This means users can interact with your app even before the app has hydrated.
When the <CodeStepstep={2}>permalink</CodeStep> is provided to `useActionState`, React will redirect to the provided URL if the form is submitted before the JavaScript bundle loads.
0 commit comments