Skip to content

Commit fbde68f

Browse files
authored
Merge pull request #721 from reactjs/tr/useFormStatus
Translate "useFormStatus"
2 parents 610e57e + ed54b0f commit fbde68f

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

src/content/reference/react-dom/hooks/useFormStatus.md

+33-33
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ canary: true
55

66
<Canary>
77

8-
The `useFormStatus` Hook is currently only available in React's Canary and experimental channels. Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
8+
`useFormStatus` フックは、現在 ReactCanary および experimental チャンネルでのみ利用可能です。[リリースチャンネルについてはこちらをご覧ください](/community/versioning-policy#all-release-channels)
99

1010
</Canary>
1111

1212
<Intro>
1313

14-
`useFormStatus` is a Hook that gives you status information of the last form submission.
14+
`useFormStatus` は、直近のフォーム送信に関するステータス情報を提供するフックです。
1515

1616
```js
1717
const { pending, data, method, action } = useFormStatus();
@@ -23,11 +23,11 @@ const { pending, data, method, action } = useFormStatus();
2323

2424
---
2525

26-
## Reference {/*reference*/}
26+
## リファレンス {/*reference*/}
2727

2828
### `useFormStatus()` {/*use-form-status*/}
2929

30-
The `useFormStatus` Hook provides status information of the last form submission.
30+
`useFormStatus` フックは、直近のフォーム送信に関するステータス情報を提供します。
3131

3232
```js {5},[[1, 6, "status.pending"]]
3333
import { useFormStatus } from "react-dom";
@@ -47,42 +47,42 @@ export default App() {
4747
}
4848
```
4949

50-
To get status information, the `Submit` component must be rendered within a `<form>`. The Hook returns information like the <CodeStep step={1}>`pending`</CodeStep> property which tells you if the form is actively submitting.
50+
ステータス情報を取得するには、この `Submit` コンポーネントが `<form>` 内でレンダーされている必要があります。このフックは、フォームが送信中かどうかを示す <CodeStep step={1}>`pending`</CodeStep> プロパティなどの情報を返します。
5151

52-
In the above example, `Submit` uses this information to disable `<button>` presses while the form is submitting.
52+
上記の例では、`Submit` がこの情報を使用して、フォームが送信中の間 `<button>` を無効にして押せなくしています。
5353

54-
[See more examples below.](#usage)
54+
[さらに例を見る](#usage)
5555

56-
#### Parameters {/*parameters*/}
56+
#### 引数 {/*parameters*/}
5757

58-
`useFormStatus` does not take any parameters.
58+
`useFormStatus` は引数を受け取りません。
5959

60-
#### Returns {/*returns*/}
60+
#### 返り値 {/*returns*/}
6161

62-
A `status` object with the following properties:
62+
以下のプロパティを持つ `status` オブジェクト。
6363

64-
* `pending`: A boolean. If `true`, this means the parent `<form>` is pending submission. Otherwise, `false`.
64+
* `pending`: ブーリアン。`true` の場合、親 `<form>` で送信が進行中であることを意味します。それ以外の場合は `false` となります。
6565

66-
* `data`: An object implementing the [`FormData interface`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) that contains the data the parent `<form>` is submitting. If there is no active submission or no parent `<form>`, it will be `null`.
66+
* `data`: [`FormData` インターフェース](https://developer.mozilla.org/en-US/docs/Web/API/FormData)を実装したオブジェクト。親 `<form>` が送信中のデータを含んでいます。送信がアクティブでない場合や親 `<form>` がない場合は `null` になります。
6767

68-
* `method`: A string value of either `'get'` or `'post'`. This represents whether the parent `<form>` is submitting with either a `GET` or `POST` [HTTP method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods). By default, a `<form>` will use the `GET` method and can be specified by the [`method`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#method) property.
68+
* `method`: `'get'` または `'post'` のいずれかの文字列。親 `<form>` `GET` `POST` [HTTP メソッド](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)のどちらで送信されているかを表します。デフォルトでは、`<form>` `GET` メソッドを使用しますが、[`method`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#method) によって指定することができます。
6969

7070
[//]: # (Link to `<form>` documentation. "Read more on the `action` prop on `<form>`.")
71-
* `action`: A reference to the function passed to the `action` prop on the parent `<form>`. If there is no parent `<form>`, the property is `null`. If there is a URI value provided to the `action` prop, or no `action` prop specified, `status.action` will be `null`.
71+
* `action`: `<form>` の props である `action` に渡された関数への参照。親 `<form>` がない場合、このプロパティは `null` です。`action` プロパティに URI 値が渡された場合や `action` プロパティが指定されていない場合も、`status.action` `null` になります。
7272

73-
#### Caveats {/*caveats*/}
73+
#### 注意点 {/*caveats*/}
7474

75-
* The `useFormStatus` Hook must be called from a component that is rendered inside a `<form>`.
76-
* `useFormStatus` will only return status information for a parent `<form>`. It will not return status information for any `<form>` rendered in that same component or children components.
75+
* `useFormStatus` フックは、`<form>` 内でレンダーされるコンポーネントから呼び出す必要があります。
76+
* `useFormStatus` は親 `<form>` のステータス情報のみを返します。同じコンポーネントや子コンポーネント内でレンダーされた `<form>` のステータス情報は返しません。
7777

7878
---
7979

80-
## Usage {/*usage*/}
80+
## 使用法 {/*usage*/}
8181

82-
### Display a pending state during form submission {/*display-a-pending-state-during-form-submission*/}
83-
To display a pending state while a form is submitting, you can call the `useFormStatus` Hook in a component rendered in a `<form>` and read the `pending` property returned.
82+
### フォーム送信中にステータスを表示 {/*display-a-pending-state-during-form-submission*/}
83+
フォームの送信中にそのステータスを表示するには、`<form>` 内でレンダーされるコンポーネントで `useFormStatus` フックを呼び出し、返された `pending` プロパティを読み取ります。
8484

85-
Here, we use the `pending` property to indicate the form is submitting.
85+
以下では、フォームが送信中であることを示すために `pending` プロパティを使用しています。
8686

8787
<Sandpack>
8888

@@ -133,9 +133,9 @@ export async function submitForm(query) {
133133

134134
<Pitfall>
135135

136-
##### `useFormStatus` will not return status information for a `<form>` rendered in the same component. {/*useformstatus-will-not-return-status-information-for-a-form-rendered-in-the-same-component*/}
136+
##### `useFormStatus` は同じコンポーネントでレンダーされた `<form>` のステータス情報を返さない {/*useformstatus-will-not-return-status-information-for-a-form-rendered-in-the-same-component*/}
137137

138-
The `useFormStatus` Hook only returns status information for a parent `<form>` and not for any `<form>` rendered in the same component calling the Hook, or child components.
138+
`useFormStatus` フックは親の `<form>` に対するステータス情報のみを返します。フックを呼び出しているのと同じコンポーネントや子コンポーネントでレンダーされる `<form>` には対応していません。
139139

140140
```js
141141
function Form() {
@@ -146,7 +146,7 @@ function Form() {
146146
}
147147
```
148148

149-
Instead call `useFormStatus` from inside a component that is located inside `<form>`.
149+
こうするのではなく、`useFormStatus` `<form>` の内部にあるコンポーネントから呼び出してください。
150150

151151
```js
152152
function Submit() {
@@ -167,11 +167,11 @@ function Form() {
167167

168168
</Pitfall>
169169

170-
### Read the form data being submitted {/*read-form-data-being-submitted*/}
170+
### ユーザが送信中のフォームデータを読み取る {/*read-form-data-being-submitted*/}
171171

172-
You can use the `data` property of the status information returned from `useFormStatus` to display what data is being submitted by the user.
172+
`useFormStatus` から返されるステータス情報の `data` プロパティを使用して、ユーザが送信しているデータを表示できます。
173173

174-
Here, we have a form where users can request a username. We can use `useFormStatus` to display a temporary status message confirming what username they have requested.
174+
以下の例は、ユーザが自分の欲しいユーザネームを要求できるフォームです。`useFormStatus` を使用することで、ユーザがどんなユーザネームを要求したのか確認できる一時的なステータスメッセージを表示できます。
175175

176176
<Sandpack>
177177

@@ -250,12 +250,12 @@ export async function submitForm(query) {
250250
251251
---
252252
253-
## Troubleshooting {/*troubleshooting*/}
253+
## トラブルシューティング {/*troubleshooting*/}
254254
255-
### `status.pending` is never `true` {/*pending-is-never-true*/}
255+
### `status.pending` `true` にならない {/*pending-is-never-true*/}
256256
257-
`useFormStatus` will only return status information for a parent `<form>`.
257+
`useFormStatus` は親の `<form>` に対するステータス情報のみを返します。
258258
259-
If the component that calls `useFormStatus` is not nested in a `<form>`, `status.pending` will always return `false`. Verify `useFormStatus` is called in a component that is a child of a `<form>` element.
259+
`useFormStatus` を呼び出しているコンポーネントが `<form>` の中にネストされていない場合、`status.pending` は常に `false` を返します。`useFormStatus` `<form>` 要素の子コンポーネント内で呼び出されていることを確認してください。
260260
261-
`useFormStatus` will not track the status of a `<form>` rendered in the same component. See [Pitfall](#useformstatus-will-not-return-status-information-for-a-form-rendered-in-the-same-component) for more details.
261+
`useFormStatus` は、同じコンポーネントでレンダーされた `<form>` の状態は追跡しません。詳細は[落とし穴](#useformstatus-will-not-return-status-information-for-a-form-rendered-in-the-same-component)欄を参照してください。

0 commit comments

Comments
 (0)