Skip to content

Commit 1db3fa8

Browse files
committed
wip
1 parent aff743b commit 1db3fa8

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Diff for: src/content/reference/react/Fragment.md

+7-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: <Fragment> (<>...</>)
44

55
<Intro>
66

7-
`<Fragment>`, often used via `<>...</>` syntax, lets you group elements without a wrapper node.
7+
`<Fragment>`,よく`<>...</>`の形式で使用されます。ラッパーノードを必要とせずに要素をグループ化してくれます。
88

99
```js
1010
<>
@@ -19,22 +19,21 @@ title: <Fragment> (<>...</>)
1919

2020
---
2121

22-
## Reference {/*reference*/}
22+
## リファレンス {/*reference*/}
2323

2424
### `<Fragment>` {/*fragment*/}
2525

26-
Wrap elements in `<Fragment>` to group them together in situations where you need a single element. Grouping elements in `Fragment` has no effect on the resulting DOM; it is the same as if the elements were not grouped. The empty JSX tag `<></>` is shorthand for `<Fragment></Fragment>` in most cases.
26+
単一の要素が必要なときで複数の要素をまとめるために `<Fragment>` でラップします。Fragment で要素をまとめても、結果となる DOM には影響を与えません。要素がまとめられていないときと同じです。空の JSX タグ `<></>` は、ほとんどの場合 `<Fragment></Fragment>` のショートハンドです。
2727

2828
#### Props {/*props*/}
2929

30-
- **optional** `key`: Fragments declared with the explicit `<Fragment>` syntax may have [keys.](/learn/rendering-lists#keeping-list-items-in-order-with-key)
30+
- **省略可能** `key`: 明示的な `<Fragment>` 構文で宣言されたフラグメントは [keys.](/learn/rendering-lists#keeping-list-items-in-order-with-key)を持つことができます。
3131

32-
#### Caveats {/*caveats*/}
32+
#### 注意点 {/*caveats*/}
3333

34-
- If you want to pass `key` to a Fragment, you can't use the `<>...</>` syntax. You have to explicitly import `Fragment` from `'react'` and render `<Fragment key={yourKey}>...</Fragment>`.
35-
36-
- React does not [reset state](/learn/preserving-and-resetting-state) when you go from rendering `<><Child /></>` to `[<Child />]` or back, or when you go from rendering `<><Child /></>` to `<Child />` and back. This only works a single level deep: for example, going from `<><><Child /></></>` to `<Child />` resets the state. See the precise semantics [here.](https://gist.github.com/clemmy/b3ef00f9507909429d8aa0d3ee4f986b)
34+
- `key` をフラグメントに渡したいなら、`<>...</>` の構文を使用することはできません。`'react'` から `Fragment` を明示的にインポートし、`<Fragment key={yourKey}>...</Fragment>` をレンダーする必要があります。
3735

36+
- React は、`<><Child /></>` のレンダーから `[<Child />]` への変更、あるいはその逆、または `<><Child /></>` のレンダーから `<Child />` への変更、その逆に移行するときに [state をリセット](/learn/preserving-and-resetting-state) しません。これは 1 つのレベルまでのみ機能します:例えば、`<><><Child /></></>` から `<Child />` への変更は state をリセットします。詳細については [こちら](https://gist.github.com/clemmy/b3ef00f9507909429d8aa0d3ee4f986b) をご覧ください。
3837
---
3938

4039
## Usage {/*usage*/}

0 commit comments

Comments
 (0)