Skip to content

Commit ce55111

Browse files
yoeubitaehwanno
authored andcommitted
Translate fragments (#83)
* translate-fragments * reflect review
1 parent 01d7b74 commit ce55111

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

content/docs/fragments.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Fragments
44
permalink: docs/fragments.html
55
---
66

7-
A common pattern in React is for a component to return multiple elements. Fragments let you group a list of children without adding extra nodes to the DOM.
7+
React에서 컴포넌트가 여러 엘리먼트를 반환하는 것은 흔한 패턴입니다. Fragments는 DOM에 별도의 노드를 추가하지 않고 여러 자식을 그룹화할 수 있습니다.
88

99
```js
1010
render() {
@@ -16,13 +16,13 @@ render() {
1616
</React.Fragment>
1717
);
1818
}
19-
```
19+
```
2020

21-
There is also a new [short syntax](#short-syntax) for declaring them, but it isn't supported by all popular tools yet.
21+
이를 선언하는 새로운 [단축 문법](#short-syntax)이 있습니다. 하지만 아직 모든 인기 있는 도구에서 전부 지원하지는 않습니다.
2222

23-
## Motivation {#motivation}
23+
## 동기 {#motivation}
2424

25-
A common pattern is for a component to return a list of children. Take this example React snippet:
25+
컴포넌트가 여러 자식을 반환하는 것은 흔한 패턴입니다. 다음 React 예시를 보세요.
2626

2727
```jsx
2828
class Table extends React.Component {
@@ -38,7 +38,7 @@ class Table extends React.Component {
3838
}
3939
```
4040

41-
`<Columns />` would need to return multiple `<td>` elements in order for the rendered HTML to be valid. If a parent div was used inside the `render()` of `<Columns />`, then the resulting HTML will be invalid.
41+
렌더링 된 HTML이 유효하려면 `<Columns />`가 여러 `<td>` 엘리먼트만 반환해야 합니다. `<Columns />``render()` 안에 부모 div로 자식들을 감싼다면 렌더링 된 HTML은 유효하지 않습니다.
4242

4343
```jsx
4444
class Columns extends React.Component {
@@ -53,7 +53,7 @@ class Columns extends React.Component {
5353
}
5454
```
5555

56-
results in a `<Table />` output of:
56+
`<Table />`의 출력 결과는 다음과 같습니다.
5757

5858
```jsx
5959
<table>
@@ -66,9 +66,9 @@ results in a `<Table />` output of:
6666
</table>
6767
```
6868

69-
Fragments solve this problem.
69+
Fragments는 이 문제를 해결해줍니다.
7070

71-
## Usage {#usage}
71+
## 사용법 {#usage}
7272

7373
```jsx{4,7}
7474
class Columns extends React.Component {
@@ -83,7 +83,7 @@ class Columns extends React.Component {
8383
}
8484
```
8585

86-
which results in a correct `<Table />` output of:
86+
올바른 `<Table />`의 출력 결과는 아래와 같습니다.
8787

8888
```jsx
8989
<table>
@@ -94,9 +94,9 @@ which results in a correct `<Table />` output of:
9494
</table>
9595
```
9696

97-
### Short Syntax {#short-syntax}
97+
### 단축 문법 {#short-syntax}
9898

99-
There is a new, shorter syntax you can use for declaring fragments. It looks like empty tags:
99+
Fragments를 선언하는 더 짧고 새로운 문법이 있습니다. 마치 빈 태그와 같습니다.
100100

101101
```jsx{4,7}
102102
class Columns extends React.Component {
@@ -111,20 +111,20 @@ class Columns extends React.Component {
111111
}
112112
```
113113

114-
You can use `<></>` the same way you'd use any other element except that it doesn't support keys or attributes.
114+
`key` 또는 어트리뷰트를 지원하지 않는다는 것을 빼고 다른 엘리먼트처럼 `<></>`을 사용할 수 있습니다.
115115

116-
Note that **[many tools don't support it yet](/blog/2017/11/28/react-v16.2.0-fragment-support.html#support-for-fragment-syntax)** so you might want to explicitly write `<React.Fragment>` until the tooling catches up.
116+
주의: **[아직 많은 도구에서 이 단축 문법이 지원이 안 되기 때문에](/blog/2017/11/28/react-v16.2.0-fragment-support.html#support-for-fragment-syntax)** 그전까지는 명시적으로 `<React.Fragmemt>`를 사용해야 하는 것에 주의해야 합니다.
117117

118-
### Keyed Fragments {#keyed-fragments}
118+
### key가 있는 Fragments {#keyed-fragments}
119119

120-
Fragments declared with the explicit `<React.Fragment>` syntax may have keys. A use case for this is mapping a collection to an array of fragments -- for example, to create a description list:
120+
Fragments에 `key`가 있다면 `<React.Fragment>` 문법으로 명시적으로 선언해야 합니다. 예를 들어 정의 목록을 만들기 위해 컬렉션을 fragments 배열로 매핑하는 사용 사례입니다.
121121

122122
```jsx
123123
function Glossary(props) {
124124
return (
125125
<dl>
126126
{props.items.map(item => (
127-
// Without the `key`, React will fire a key warning
127+
// React는 `key`가 없으면 key warning을 발생합니다.
128128
<React.Fragment key={item.id}>
129129
<dt>{item.term}</dt>
130130
<dd>{item.description}</dd>
@@ -135,8 +135,8 @@ function Glossary(props) {
135135
}
136136
```
137137

138-
`key` is the only attribute that can be passed to `Fragment`. In the future, we may add support for additional attributes, such as event handlers.
138+
`key``Fragment`에 전달할 수 있는 유일한 어트리뷰트입니다. 추후 이벤트 핸들러와 같은 추가적인 어트리뷰트를 지원할 수도 있습니다.
139139

140-
### Live Demo {#live-demo}
140+
### 라이브 데모 {#live-demo}
141141

142-
You can try out the new JSX fragment syntax with this [CodePen](https://codepen.io/reactjs/pen/VrEbjE?editors=1000).
142+
[CodePen](https://codepen.io/reactjs/pen/VrEbjE?editors=1000)에서 새로운 JSX fragment 문법을 사용해 볼 수 있습니다.

0 commit comments

Comments
 (0)