Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/content/reference/react-dom/components/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,31 +164,31 @@ React는 브라우저에 내장된 모든 HTML 컴포넌트를 지원합니다.

### 커스텀 HTML 요소 {/*custom-html-elements*/}

If you render a tag with a dash, like `<my-element>`, React will assume you want to render a [custom HTML element.](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements)
`<my-element>`처럼 대시(`-`)가 포함된 태그를 렌더링하면, React는 [커스텀 HTML 엘리먼트](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements)를 렌더링하려는 것으로 간주합니다.

[`is`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/is) 어트리뷰트를 사용하여 브라우저 내장 HTML 요소를 렌더링하면 커스텀 엘리먼트로 취급됩니다.

#### Setting values on custom elements {/*attributes-vs-properties*/}
#### 커스텀 엘리먼트에 값 설정하기 {/*attributes-vs-properties*/}

Custom elements have two methods of passing data into them:
커스텀 엘리먼트에 데이터를 전달하는 방법은 두 가지입니다.

1) Attributes: Which are displayed in markup and can only be set to string values
2) Properties: Which are not displayed in markup and can be set to arbitrary JavaScript values
1) 어트리뷰트: 마크업에 표시되며 문자열 값만 설정할 수 있습니다.
2) 프로퍼티: 마크업에 표시되지 않으며 임의의 JavaScript 값을 설정할 수 있습니다.

By default, React will pass values bound in JSX as attributes:
기본적으로 React는 JSX에 바인딩된 값을 어트리뷰트로 전달합니다.

```jsx
<my-element value="Hello, world!"></my-element>
```

Non-string JavaScript values passed to custom elements will be serialized by default:
커스텀 엘리먼트에 전달된 문자열이 아닌 JavaScript 값은 기본적으로 직렬화됩니다.

```jsx
// Will be passed as `"1,2,3"` as the output of `[1,2,3].toString()`
<my-element value={[1,2,3]}></my-element>
```

React will, however, recognize a custom element's property as one that it may pass arbitrary values to if the property name shows up on the class during construction:
하지만 생성 시점에 클래스에 해당 프로퍼티 이름이 존재하면, React는 그 프로퍼티를 임의의 값을 전달할 수 있는 커스텀 엘리먼트의 프로퍼티로 인식합니다.

<Sandpack>

Expand Down Expand Up @@ -226,9 +226,9 @@ export function App() {

</Sandpack>

#### Listening for events on custom elements {/*custom-element-events*/}
#### 커스텀 엘리먼트의 이벤트 수신하기 {/*custom-element-events*/}

A common pattern when using custom elements is that they may dispatch [`CustomEvent`s](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent) rather than accept a function to call when an event occur. You can listen for these events using an `on` prefix when binding to the event via JSX.
커스텀 엘리먼트는 이벤트가 발생했을 때 호출할 함수를 받는 대신 [`CustomEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)를 발생시키는 경우가 많습니다. JSX에서 이벤트를 바인딩할 때 `on` 접두사를 붙여 이러한 이벤트를 수신할 수 있습니다.

<Sandpack>

Expand Down Expand Up @@ -287,7 +287,7 @@ export function App() {

<Note>

Events are case-sensitive and support dashes (`-`). Preserve the casing of the event and include all dashes when listening for custom element's events:
이벤트 이름은 대소문자를 구분하며 대시(`-`)를 포함할 수 있습니다. 커스텀 엘리먼트의 이벤트를 수신할 때는 이벤트 이름의 대소문자를 그대로 유지하고 대시도 모두 포함하세요.

```jsx
// Listens for `say-hi` events
Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/react-dom/components/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ title: "<input>"

`<input>`은 모든 [공통 엘리먼트 Props](/reference/react-dom/components/common#common-props)를 지원합니다.

- [`formAction`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#formaction): A string or function. Overrides the parent `<form action>` for `type="submit"` and `type="image"`. When a URL is passed to `action` the form will behave like a standard HTML form. When a function is passed to `formAction` the function will handle the form submission. See [`<form action>`](/reference/react-dom/components/form#props).
- [`formAction`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#formaction): 문자열 또는 함수 타입. `type="submit"`과 `type="image"`의 부모 `<form action>`을 덮어씁니다. URL을 `action`에 전달하면 폼은 표준 HTML 폼처럼 동작합니다. 함수를 `formAction`에 전달하면 해당 함수가 폼 제출을 처리합니다. [`<form action>`](/reference/react-dom/components/form#props)을 참고하세요.

You can [make an input controlled](#controlling-an-input-with-a-state-variable) by passing one of these props:
다음 Props 중 하나를 전달하면 [입력을 제어](#controlling-an-input-with-a-state-variable)할 수 있습니다.

* [`checked`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#checked): 불리언 타입. 체크박스 입력 또는 라디오 버튼에서 선택 여부를 제어합니다.
* [`value`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#value): 문자열 타입. 텍스트 입력의 경우 텍스트를 제어합니다. (라디오 버튼의 경우 폼 데이터를 지정합니다.)
Expand Down