Skip to content

Commit f5f90c3

Browse files
hiddenesttaehwanno
authored andcommitted
Translate Web Components (#48)
* Translate Web Components * Update with Reviews * Update web-components.md `주의:`에서 콜론을 제거 했습니다. 현재 [textlint 룰](https://github.com/reactjs/ko.reactjs.org/blob/master/textlint/rules/no-endline-colon.js) 에서 문장 맨끝에 콜론 사용을 안하는 걸로 되어 있어서요. * Update with Reviews * Fix doc format
1 parent 648d939 commit f5f90c3

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

content/docs/web-components.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
id: web-components
3-
title: Web Components
3+
title: 웹 컴포넌트
44
permalink: docs/web-components.html
55
redirect_from:
66
- "docs/webcomponents.html"
77
---
88

9-
React and [Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Components) are built to solve different problems. Web Components provide strong encapsulation for reusable components, while React provides a declarative library that keeps the DOM in sync with your data. The two goals are complementary. As a developer, you are free to use React in your Web Components, or to use Web Components in React, or both.
9+
React와 [웹 컴포넌트](https://developer.mozilla.org/ko/docs/Web/Web_Components)는 서로 다른 문제를 해결하기 위해 만들어졌습니다. 웹 컴포넌트는 재사용할 수 있는 컴포넌트에 강한 캡슐화를 제공하는 반면, React는 데이터와 DOM을 동기화하는 선언적 라이브러리를 제공합니다.
1010

11-
Most people who use React don't use Web Components, but you may want to, especially if you are using third-party UI components that are written using Web Components.
11+
두 목표는 상호보완적입니다. React에서 웹 컴포넌트를 사용할지, 웹 컴포넌트를 React에서 사용할지, 둘 다 사용할지는 자유롭게 정하실 수 있습니다.
1212

13-
## Using Web Components in React {#using-web-components-in-react}
13+
## React에서 웹 컴포넌트 사용하기 {#using-web-components-in-react}
1414

1515
```javascript
1616
class HelloMessage extends React.Component {
@@ -20,14 +20,13 @@ class HelloMessage extends React.Component {
2020
}
2121
```
2222

23-
> Note:
23+
> 주의
2424
>
25-
> Web Components often expose an imperative API. For instance, a `video` Web Component might expose `play()` and `pause()` functions. To access the imperative APIs of a Web Component, you will need to use a ref to interact with the DOM node directly. If you are using third-party Web Components, the best solution is to write a React component that behaves as a wrapper for your Web Component.
25+
> 웹 컴포넌트는 종종 강제성을 띠는 API를 열어놓고 있습니다. 예를 들어, `video`라는 웹 컴포넌트는 `play()``pause()`라는 함수를 열어놓고 있을 것입니다. 이러한 웹 컴포넌트의 강제성을 띠는 API에 접근하기 위해서, DOM 노드에 직접 ref를 지정하는 것이 필요할 수 있습니다. 서드 파티 웹 컴포넌트를 사용 중이라면, 가장 좋은 해결방법은 웹 컴포넌트의 래퍼로서 동작하는 React 컴포넌트를 작성하는 것입니다.
2626
>
27-
> Events emitted by a Web Component may not properly propagate through a React render tree.
28-
> You will need to manually attach event handlers to handle these events within your React components.
27+
> 웹 컴포넌트에서 나온 이벤트들은 React 렌더링 트리에 올바르게 전파되지 않을 수 있습니다. 이를 해결하기 위해 이벤트를 다루기 위한 핸들러를 React 컴포넌트 내에 각각 만들어야합니다.
2928
30-
One common confusion is that Web Components use "class" instead of "className".
29+
많은 사람이 공통으로 착각하는 부분 중 하나로, 웹 컴포넌트는 “className”이 아닌 “class”를 사용합니다.
3130

3231
```javascript
3332
function BrickFlipbox() {
@@ -40,7 +39,7 @@ function BrickFlipbox() {
4039
}
4140
```
4241

43-
## Using React in your Web Components {#using-react-in-your-web-components}
42+
## 웹 컴포넌트에서 React 사용하기 {#using-react-in-your-web-components}
4443

4544
```javascript
4645
class XSearch extends HTMLElement {
@@ -56,7 +55,7 @@ class XSearch extends HTMLElement {
5655
customElements.define('x-search', XSearch);
5756
```
5857

59-
>Note:
58+
>주의
6059
>
61-
>This code **will not** work if you transform classes with Babel. See [this issue](https://github.com/w3c/webcomponents/issues/587) for the discussion.
62-
>Include the [custom-elements-es5-adapter](https://github.com/webcomponents/webcomponentsjs#custom-elements-es5-adapterjs) before you load your web components to fix this issue.
60+
>Babel로 클래스를 변환하면 이 코드가 작동하지 **않을 것**입니다. [해당 문제](https://github.com/w3c/webcomponents/issues/587)를 참조해주시기 바랍니다.
61+
>이 문제를 해결하려면 웹 컴포넌트를 불러오기 전에 [custom-elements-es5-adapter](https://github.com/webcomponents/webcomponentsjs#custom-elements-es5-adapterjs)를 추가하기 바랍니다.

0 commit comments

Comments
 (0)