Skip to content

Commit 3054547

Browse files
authored
docs: translate <img> component reference to Korean (#1588)
## 개요 `<img>` 컴포넌트 레퍼런스 페이지 전체를 한국어로 번역했습니다. (resolves #1577) - Props, 주의 사항, 사용법(이미지 표시, 서버 렌더링 중 프리로드 제어, View Transition 중 이미지 대기) 전체 번역 - 코드 예제와 헤딩 앵커는 원문과 동일하게 유지 - MDN 링크는 기존 번역 페이지들과 동일하게 `/ko/` 로케일로 연결 - [공통 스타일 가이드](https://github.com/reactjs/ko.react.dev/blob/main/wiki/universal-style-guide.md)와 [번역 용어집](https://github.com/reactjs/ko.react.dev/blob/main/wiki/translate-glossary.md)을 참고했습니다
1 parent bfa2c4f commit 3054547

1 file changed

Lines changed: 43 additions & 43 deletions

File tree

  • src/content/reference/react-dom/components

‎src/content/reference/react-dom/components/img.md‎

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: "<img>"
44

55
<Intro>
66

7-
The [built-in browser `<img>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img) lets you embed an image.
7+
[내장 브라우저 `<img>` 컴포넌트](https://developer.mozilla.org/ko/docs/Web/HTML/Element/img)를 사용하면 이미지를 삽입할 수 있습니다.
88

99
```js
1010
<img src="photo.jpg" alt="A person walking through a park" />
@@ -16,50 +16,50 @@ The [built-in browser `<img>` component](https://developer.mozilla.org/en-US/doc
1616

1717
---
1818

19-
## Reference {/*reference*/}
19+
## 레퍼런스 {/*reference*/}
2020

2121
### `<img>` {/*img*/}
2222

23-
To display an image, render the [built-in browser `<img>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img).
23+
이미지를 표시하려면 [내장 브라우저 `<img>` 컴포넌트](https://developer.mozilla.org/ko/docs/Web/HTML/Element/img)를 렌더링합니다.
2424

2525
```js
2626
<img src="photo.jpg" alt="A person walking through a park" />
2727
```
2828

29-
[See more examples below.](#usage)
29+
[아래 예시를 참고하세요.](#usage)
3030

3131
#### Props {/*props*/}
3232

33-
`<img>` supports all [common element props.](/reference/react-dom/components/common#common-props)
34-
35-
* `alt`: a string. Specifies alternative text for the image. Use an empty string for a purely decorative image.
36-
* `crossOrigin`: a string. Specifies the [CORS policy](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) to use when fetching the image. The possible values are `anonymous` and `use-credentials`.
37-
* `decoding`: a string. Suggests whether the browser should wait to decode the image before presenting other content. The possible values are `async`, `sync`, and `auto` (the default).
38-
* `fetchPriority`: a string. Suggests a relative priority for fetching the image. The possible values are `high`, `low`, and `auto` (the default). During server rendering, `fetchPriority="low"` also prevents React from [automatically preloading the image.](#controlling-image-preloading-during-server-rendering)
39-
* `height`: a number or string. Specifies the rendered height of the image.
40-
* `loading`: a string. Specifies whether the browser should defer loading the image until it is near the viewport. The possible values are `eager` (the default) and `lazy`. Setting `loading="lazy"` prevents React from [automatically preloading the image.](#controlling-image-preloading-during-server-rendering)
41-
* `onError`: an [event handler](/reference/react-dom/components/common#event-handler) function. Fires when the image fails to load.
42-
* `onLoad`: an [event handler](/reference/react-dom/components/common#event-handler) function. Fires when the image finishes loading. Passing `onLoad` prevents React from [waiting for the image during a client-rendered View Transition update.](#waiting-for-an-image-during-a-view-transition)
43-
* `referrerPolicy`: a string. Specifies the [referrer information](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#referrerpolicy) to send when fetching the image.
44-
* `sizes`: a string. Specifies the image sizes for different page layouts. Used with `srcSet`.
45-
* `src`: a string. Specifies the URL of the image.
46-
* `srcSet`: a string. Specifies one or more candidate image sources for the browser to choose from.
47-
* `useMap`: a string. Associates the image with a [client-side image map](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/map).
48-
* `width`: a number or string. Specifies the rendered width of the image.
49-
50-
#### Caveats {/*caveats*/}
51-
52-
* Do not pass an empty string to `src`. It may cause the browser to request the current page again. React warns in development and omits the attribute. To render no image, omit the `<img>` or pass `null` to `src`.
53-
* `<img>` cannot have children or use `dangerouslySetInnerHTML`. React throws an error if you pass either.
54-
* `fetchPriority="low"` does not stop React from waiting for the image to load and decode during a client-rendered View Transition update. Use `loading="lazy"` or an `onLoad` handler to opt out of that behavior.
33+
`<img>`는 모든 [공통 엘리먼트 Props](/reference/react-dom/components/common#common-props)를 지원합니다.
34+
35+
* `alt`: 문자열. 이미지에 대한 대체 텍스트를 지정합니다. 순수하게 장식용인 이미지에는 빈 문자열을 사용하세요.
36+
* `crossOrigin`: 문자열. 이미지를 가져올 때 사용할 [CORS 정책](https://developer.mozilla.org/ko/docs/Web/HTML/Attributes/crossorigin)을 지정합니다. 가능한 값은 `anonymous`와 `use-credentials`입니다.
37+
* `decoding`: 문자열. 브라우저가 다른 콘텐츠를 표시하기 전에 이미지 디코딩을 기다려야 하는지에 대한 힌트를 지정합니다. 가능한 값은 `async`, `sync`, `auto`(기본값)입니다.
38+
* `fetchPriority`: 문자열. 이미지를 가져올 상대적 우선순위에 대한 힌트를 지정합니다. 가능한 값은 `high`, `low`, `auto`(기본값)입니다. 서버 렌더링 중에는 `fetchPriority="low"`가 React의 [자동 이미지 프리로드](#controlling-image-preloading-during-server-rendering)도 막습니다.
39+
* `height`: 숫자 또는 문자열. 이미지가 렌더링될 높이를 지정합니다.
40+
* `loading`: 문자열. 브라우저가 이미지가 뷰포트에 가까워질 때까지 로드를 지연해야 하는지를 지정합니다. 가능한 값은 `eager`(기본값)와 `lazy`입니다. `loading="lazy"`를 설정하면 React의 [자동 이미지 프리로드](#controlling-image-preloading-during-server-rendering)가 적용되지 않습니다.
41+
* `onError`: [이벤트 핸들러](/reference/react-dom/components/common#event-handler) 함수. 이미지 로드에 실패했을 때 호출됩니다.
42+
* `onLoad`: [이벤트 핸들러](/reference/react-dom/components/common#event-handler) 함수. 이미지 로드가 완료되었을 때 호출됩니다. `onLoad`를 전달하면 클라이언트에서 렌더링되는 View Transition 업데이트 중에 React가 [이미지를 기다리지 않습니다](#waiting-for-an-image-during-a-view-transition).
43+
* `referrerPolicy`: 문자열. 이미지를 가져올 때 보낼 [리퍼러 정보](https://developer.mozilla.org/ko/docs/Web/HTML/Element/img#referrerpolicy)를 지정합니다.
44+
* `sizes`: 문자열. 다양한 페이지 레이아웃에 대한 이미지 크기를 지정합니다. `srcSet`과 함께 사용합니다.
45+
* `src`: 문자열. 이미지의 URL을 지정합니다.
46+
* `srcSet`: 문자열. 브라우저가 선택할 수 있는 하나 이상의 후보 이미지 소스를 지정합니다.
47+
* `useMap`: 문자열. 이미지를 [클라이언트 측 이미지 맵](https://developer.mozilla.org/ko/docs/Web/HTML/Element/map)과 연결합니다.
48+
* `width`: 숫자 또는 문자열. 이미지가 렌더링될 너비를 지정합니다.
49+
50+
#### 주의 사항 {/*caveats*/}
51+
52+
* `src`에 빈 문자열을 전달하지 마세요. 브라우저가 현재 페이지를 다시 요청할 수 있습니다. React는 개발 환경에서 경고하고 해당 어트리뷰트를 생략합니다. 이미지를 렌더링하지 않으려면 `<img>`를 생략하거나 `src`에 `null`을 전달하세요.
53+
* `<img>`는 자식을 가질 수 없고 `dangerouslySetInnerHTML`도 사용할 수 없습니다. 둘 중 하나라도 전달하면 React는 오류를 발생시킵니다.
54+
* `fetchPriority="low"`는 클라이언트에서 렌더링되는 View Transition 업데이트 중에 React가 이미지의 로드와 디코딩을 기다리는 것을 막지 않습니다. 이 동작을 해제하려면 `loading="lazy"` 또는 `onLoad` 핸들러를 사용하세요.
5555

5656
---
5757

58-
## Usage {/*usage*/}
58+
## 사용법 {/*usage*/}
5959

60-
### Displaying an image {/*displaying-an-image*/}
60+
### 이미지 표시하기 {/*displaying-an-image*/}
6161

62-
Pass the image URL to `src` and a text description to `alt`:
62+
이미지 URL을 `src`에, 텍스트 설명을 `alt`에 전달하세요.
6363

6464
<Sandpack>
6565

@@ -85,15 +85,15 @@ img {
8585

8686
</Sandpack>
8787

88-
Specify `width` and `height` when you know the image dimensions so the browser can reserve space before the image loads. For a decorative image, pass `alt=""` so that screen readers ignore it.
88+
이미지의 크기를 알고 있다면 `width`와 `height`를 지정하여 브라우저가 이미지가 로드되기 전에 공간을 확보할 수 있도록 하세요. 장식용 이미지라면 스크린 리더가 무시할 수 있도록 `alt=""`를 전달하세요.
8989

9090
---
9191

92-
### Controlling image preloading during server rendering {/*controlling-image-preloading-during-server-rendering*/}
92+
### 서버 렌더링 중 이미지 프리로드 제어하기 {/*controlling-image-preloading-during-server-rendering*/}
9393

94-
During server rendering, React automatically generates a preload hint for an `<img>` by default. This can let the browser start fetching the image before it encounters the `<img>` in the rendered HTML.
94+
서버 렌더링 중에 React는 기본적으로 `<img>`에 대한 프리로드 힌트를 자동으로 생성합니다. 이를 통해 브라우저가 렌더링된 HTML에서 `<img>`를 만나기 전에 이미지 가져오기를 시작할 수 있습니다.
9595

96-
Add `loading="lazy"` or `fetchPriority="low"` to an image that should not receive this hint:
96+
이 힌트를 받지 않아야 하는 이미지에는 `loading="lazy"` 또는 `fetchPriority="low"`를 추가하세요.
9797

9898
```js
9999
function ProductPage() {
@@ -107,31 +107,31 @@ function ProductPage() {
107107
}
108108
```
109109

110-
In this example, React generates a preload hint only for `hero.jpg`. Depending on the server API or framework, React may render the equivalent of this element:
110+
이 예시에서 React는 `hero.jpg`에 대해서만 프리로드 힌트를 생성합니다. 서버 API나 프레임워크에 따라 React는 다음 엘리먼트에 해당하는 결과를 렌더링할 수 있습니다.
111111

112112
```html
113113
<link rel="preload" as="image" href="hero.jpg" />
114114
```
115115

116-
React may instead provide the same hint in a `Link` response header. The other two images keep their `loading` and `fetchPriority` props in the rendered HTML, but React does not generate preload hints for them. The `loading="lazy"` prop asks the browser to defer loading an image until it approaches the viewport. The `fetchPriority="low"` prop allows the image to load immediately, but tells the browser to fetch it at a lower priority.
116+
React는 대신 `Link` 응답 헤더로 동일한 힌트를 제공할 수도 있습니다. 나머지 두 이미지는 렌더링된 HTML에서 `loading`과 `fetchPriority` props를 그대로 유지하지만, React는 이들에 대한 프리로드 힌트를 생성하지 않습니다. `loading="lazy"` prop은 브라우저에 이미지가 뷰포트에 가까워질 때까지 로드를 지연하도록 요청합니다. `fetchPriority="low"` prop은 이미지가 즉시 로드될 수 있도록 허용하면서도, 브라우저에 더 낮은 우선순위로 가져오도록 지시합니다.
117117

118-
React also does not automatically preload an image when it is inside a `<picture>` or `<noscript>` element, or when its `src` or `srcSet` is a data URL.
118+
이미지가 `<picture>`나 `<noscript>` 엘리먼트 안에 있는 경우, 또는 `src` 또는 `srcSet`이 데이터 URL인 경우에도 React는 이미지를 자동으로 프리로드하지 않습니다.
119119

120-
If you render an image through a framework or a component library, consult its documentation for the default behavior. React decides whether to generate an automatic preload from the props of the underlying `<img>`. For example, an image component may add `loading="lazy"` by default and provide a separate option for explicitly preloading selected images.
120+
프레임워크나 컴포넌트 라이브러리를 통해 이미지를 렌더링하는 경우에는 해당 문서에서 기본 동작을 확인하세요. React는 내부적인 `<img>`의 props를 기반으로 자동 프리로드 생성 여부를 결정합니다. 예를 들어 어떤 이미지 컴포넌트는 기본적으로 `loading="lazy"`를 추가하고, 선택한 이미지를 명시적으로 프리로드하는 별도의 옵션을 제공할 수 있습니다.
121121

122-
To create an explicit preload hint, call [`preload`](/reference/react-dom/preload).
122+
명시적인 프리로드 힌트를 만들려면 [`preload`](/reference/react-dom/preload)를 호출하세요.
123123

124124
---
125125

126-
### Waiting for an image during a View Transition {/*waiting-for-an-image-during-a-view-transition*/}
126+
### View Transition 중 이미지 기다리기 {/*waiting-for-an-image-during-a-view-transition*/}
127127

128-
During a client-rendered [`<ViewTransition>`](/reference/react/ViewTransition) update, React may wait for an image to load and decode before starting the animation. This applies when a new `<img>` with a non-empty `src` is rendered, or when an existing image's `src` or `srcSet` changes. The image must be inside the `<ViewTransition>` subtree and must not have `loading="lazy"` or an `onLoad` handler. React does not wait for images during synchronous updates.
128+
클라이언트에서 렌더링되는 [`<ViewTransition>`](/reference/react/ViewTransition) 업데이트 중에 React는 애니메이션을 시작하기 전에 이미지가 로드되고 디코딩될 때까지 기다릴 수 있습니다. 이는 비어있지 않은 `src`를 가진 새로운 `<img>`가 렌더링되거나, 기존 이미지의 `src` 또는 `srcSet`이 변경될 때 적용됩니다. 이미지는 `<ViewTransition>` 하위 트리 안에 있어야 하며 `loading="lazy"`나 `onLoad` 핸들러가 없어야 합니다. React는 동기 업데이트 중에는 이미지를 기다리지 않습니다.
129129

130-
When a Suspense boundary reveals streamed content inside a `<ViewTransition>`, React may also wait for visible images with a non-empty `src` that do not have `loading="lazy"`. React stops waiting after a timeout so that a slow image does not block the update indefinitely.
130+
Suspense 경계가 `<ViewTransition>` 내부에서 스트리밍된 콘텐츠를 표시할 때, React는 `loading="lazy"`가 없고 비어있지 않은 `src`를 가진 보이는 이미지들도 기다릴 수 있습니다. 느린 이미지가 업데이트를 무한정 막지 않도록, React는 타임아웃 후에 기다리기를 중단합니다.
131131

132-
In this example, the Suspense boundary is wrapped in a `<ViewTransition>` and shows a profile skeleton until the portrait has loaded.
132+
이 예시에서 Suspense 경계는 `<ViewTransition>`으로 감싸져 있고, 인물 사진이 로드될 때까지 프로필 스켈레톤을 보여줍니다.
133133

134-
For comparison, the second button inserts the same card directly into the DOM. The card appears immediately, and the browser displays the image after it loads:
134+
비교를 위해, 두 번째 버튼은 동일한 카드를 DOM에 직접 삽입합니다. 카드는 즉시 나타나고, 브라우저는 이미지가 로드된 후에 이미지를 표시합니다.
135135

136136
<Sandpack>
137137

0 commit comments

Comments
 (0)