Skip to content

Commit 2383c95

Browse files
committed
docs: translate FragmentInstance reference to Korean (#1579)
1 parent 89f79e9 commit 2383c95

1 file changed

Lines changed: 78 additions & 78 deletions

File tree

‎src/content/reference/react/Fragment.md‎

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -44,244 +44,244 @@ title: <Fragment> (<>...</>)
4444

4545
### `FragmentInstance` {/*fragmentinstance*/}
4646

47-
When you pass a `ref` to a Fragment, React provides a `FragmentInstance` object. It implements methods for interacting with the first-level DOM children wrapped by the Fragment.
47+
Fragment에 `ref`를 전달하면 React는 `FragmentInstance` 객체를 제공합니다. 이 객체는 Fragment로 감싼 1단계 자식 DOM 노드와 상호작용하기 위한 메서드를 구현합니다.
4848

49-
* [`addEventListener`](#addeventlistener) and [`removeEventListener`](#removeeventlistener) manage event listeners across all first-level DOM children.
50-
* [`dispatchEvent`](#dispatchevent) dispatches an event on the Fragment, which can bubble to the DOM parent.
51-
* [`focus`](#focus), [`focusLast`](#focuslast), and [`blur`](#blur) manage focus across all nested children depth-first.
52-
* [`observeUsing`](#observeusing) and [`unobserveUsing`](#unobserveusing) attach and detach `IntersectionObserver` or `ResizeObserver` instances.
53-
* [`getClientRects`](#getclientrects) returns bounding rectangles of all first-level DOM children.
54-
* [`getRootNode`](#getrootnode) returns the root node of the Fragment's parent.
55-
* [`compareDocumentPosition`](#comparedocumentposition) compares the Fragment's position with another node.
56-
* [`scrollIntoView`](#scrollintoview) scrolls the Fragment's children into view.
49+
* [`addEventListener`](#addeventlistener) 및 [`removeEventListener`](#removeeventlistener): 모든 1단계 자식 DOM에 걸쳐 이벤트 리스너를 관리합니다.
50+
* [`dispatchEvent`](#dispatchevent): Fragment에서 이벤트를 발생시키며, 이 이벤트는 상위 DOM으로 버블링될 수 있습니다.
51+
* [`focus`](#focus), [`focusLast`](#focuslast), [`blur`](#blur): 깊이 우선으로 중첩된 모든 자식에 걸쳐 포커스를 관리합니다.
52+
* [`observeUsing`](#observeusing) 및 [`unobserveUsing`](#unobserveusing): `IntersectionObserver` 또는 `ResizeObserver` 인스턴스를 연결하거나 해제합니다.
53+
* [`getClientRects`](#getclientrects): 모든 1단계 자식 DOM의 경계 사각형(bounding rectangles) 배열을 반환합니다.
54+
* [`getRootNode`](#getrootnode): Fragment 상위 항목의 루트 노드를 반환합니다.
55+
* [`compareDocumentPosition`](#comparedocumentposition): Fragment의 위치를 다른 노드와 비교합니다.
56+
* [`scrollIntoView`](#scrollintoview): Fragment의 자식이 화면에 보이도록 스크롤합니다.
5757

5858
---
5959

6060
#### `addEventListener(type, listener, options?)` {/*addeventlistener*/}
6161

62-
Adds an event listener to all first-level DOM children of the Fragment.
62+
Fragment의 모든 1단계 자식 DOM에 이벤트 리스너를 추가합니다.
6363

6464
```js
6565
fragmentRef.current.addEventListener('click', handleClick);
6666
```
6767

68-
##### Parameters {/*addeventlistener-parameters*/}
68+
##### 매개변수 {/*addeventlistener-parameters*/}
6969

70-
* `type`: A string representing the event type to listen for (e.g. `'click'`, `'focus'`).
71-
* `listener`: The event handler function.
72-
* **optional** `options`: An options object or boolean for capture, matching the [DOM `addEventListener` API.](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
70+
* `type`: 수신 대기할 이벤트 타입을 나타내는 문자열(예: `'click'`, `'focus'`)입니다.
71+
* `listener`: 이벤트 핸들러 함수입니다.
72+
* **선택사항** `options`: 캡처 여부를 지정하는 불리언 또는 옵션 객체이며, [DOM `addEventListener` API](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)와 일치합니다.
7373

74-
##### Returns {/*addeventlistener-returns*/}
74+
##### 반환값 {/*addeventlistener-returns*/}
7575

76-
`addEventListener` does not return anything (`undefined`).
76+
`addEventListener`는 아무것도 반환하지 않습니다(`undefined`).
7777

7878
---
7979

8080
#### `removeEventListener(type, listener, options?)` {/*removeeventlistener*/}
8181

82-
Removes an event listener from all first-level DOM children of the Fragment.
82+
Fragment의 모든 1단계 자식 DOM에서 이벤트 리스너를 제거합니다.
8383

8484
```js
8585
fragmentRef.current.removeEventListener('click', handleClick);
8686
```
8787

88-
##### Parameters {/*removeeventlistener-parameters*/}
88+
##### 매개변수 {/*removeeventlistener-parameters*/}
8989

90-
* `type`: The event type string.
91-
* `listener`: The event handler function to remove.
92-
* **optional** `options`: An options object or boolean, matching the [DOM `removeEventListener` API.](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener)
90+
* `type`: 이벤트 타입 문자열입니다.
91+
* `listener`: 제거할 이벤트 핸들러 함수입니다.
92+
* **선택사항** `options`: 옵션 객체 또는 불리언이며, [DOM `removeEventListener` API](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener)와 일치합니다.
9393

94-
##### Returns {/*removeeventlistener-returns*/}
94+
##### 반환값 {/*removeeventlistener-returns*/}
9595

96-
`removeEventListener` does not return anything (`undefined`).
96+
`removeEventListener`는 아무것도 반환하지 않습니다(`undefined`).
9797

9898
---
9999

100100
#### `dispatchEvent(event)` {/*dispatchevent*/}
101101

102-
Dispatches an event on the Fragment. Added event listeners are called, and the event can bubble to the Fragment's DOM parent.
102+
Fragment에서 이벤트를 발생시킵니다. 등록된 이벤트 리스너가 호출되며, 이벤트는 Fragment의 상위 DOM 노드로 버블링될 수 있습니다.
103103

104104
```js
105105
fragmentRef.current.dispatchEvent(new Event('custom', { bubbles: true }));
106106
```
107107

108-
##### Parameters {/*dispatchevent-parameters*/}
108+
##### 매개변수 {/*dispatchevent-parameters*/}
109109

110-
* `event`: An [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event) object to dispatch. If `bubbles` is `true`, the event bubbles to the Fragment's parent DOM node.
110+
* `event`: 발생시킬 [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event) 객체입니다. `bubbles`가 `true`이면 이벤트가 Fragment의 상위 DOM 노드로 버블링됩니다.
111111

112-
##### Returns {/*dispatchevent-returns*/}
112+
##### 반환값 {/*dispatchevent-returns*/}
113113

114-
`true` if the event was not cancelled, `false` if `preventDefault()` was called.
114+
이벤트가 취소되지 않았으면 `true`, `preventDefault()`가 호출되었으면 `false`를 반환합니다.
115115

116116
---
117117

118118
#### `focus(options?)` {/*focus*/}
119119

120-
Focuses the first focusable DOM node in the Fragment. Unlike calling `element.focus()` on a DOM element, this method searches *all* nested children depth-first until it finds a focusable element—not just the element itself or its direct children.
120+
Fragment 내에서 포커스 가능한 첫 번째 DOM 노드에 포커스를 맞춥니다. DOM 엘리먼트에서 `element.focus()`를 호출하는 것과 달리, 이 메서드는 엘리먼트 자체나 직계 자식뿐만 아니라 포커스 가능한 요소를 찾을 때까지 중첩된 *모든* 자식을 깊이 우선으로 탐색합니다.
121121

122122
```js
123123
fragmentRef.current.focus();
124124
```
125125

126-
##### Parameters {/*focus-parameters*/}
126+
##### 매개변수 {/*focus-parameters*/}
127127

128-
* **optional** `options`: A [`FocusOptions`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options) object (e.g. `{ preventScroll: true }`).
128+
* **선택사항** `options`: [`FocusOptions`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options) 객체입니다(예: `{ preventScroll: true }`).
129129

130-
##### Returns {/*focus-returns*/}
130+
##### 반환값 {/*focus-returns*/}
131131

132-
`focus` does not return anything (`undefined`).
132+
`focus`는 아무것도 반환하지 않습니다(`undefined`).
133133

134134
---
135135

136136
#### `focusLast(options?)` {/*focuslast*/}
137137

138-
Focuses the last focusable DOM node in the Fragment. Searches nested children depth-first, then iterates in reverse.
138+
Fragment 내에서 포커스 가능한 마지막 DOM 노드에 포커스를 맞춥니다. 중첩된 자식을 깊이 우선으로 탐색한 후 역순으로 순회합니다.
139139

140140
```js
141141
fragmentRef.current.focusLast();
142142
```
143143

144-
##### Parameters {/*focuslast-parameters*/}
144+
##### 매개변수 {/*focuslast-parameters*/}
145145

146-
* **optional** `options`: A [`FocusOptions`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options) object.
146+
* **선택사항** `options`: [`FocusOptions`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options) 객체입니다.
147147

148-
##### Returns {/*focuslast-returns*/}
148+
##### 반환값 {/*focuslast-returns*/}
149149

150-
`focusLast` does not return anything (`undefined`).
150+
`focusLast`는 아무것도 반환하지 않습니다(`undefined`).
151151

152152
---
153153

154154
#### `blur()` {/*blur*/}
155155

156-
Removes focus from the active element if it is within the Fragment. If `document.activeElement` is not within the Fragment, `blur` does nothing.
156+
활성 엘리먼트가 Fragment 내에 있는 경우 포커스를 제거합니다. `document.activeElement`가 Fragment 내에 있지 않으면 `blur`는 아무 작업도 수행하지 않습니다.
157157

158158
```js
159159
fragmentRef.current.blur();
160160
```
161161

162-
##### Returns {/*blur-returns*/}
162+
##### 반환값 {/*blur-returns*/}
163163

164-
`blur` does not return anything (`undefined`).
164+
`blur`는 아무것도 반환하지 않습니다(`undefined`).
165165

166166
---
167167

168168
#### `observeUsing(observer)` {/*observeusing*/}
169169

170-
Starts observing all first-level DOM children of the Fragment with the provided observer.
170+
제공된 옵저버로 Fragment의 모든 1단계 자식 DOM에 대한 관찰을 시작합니다.
171171

172172
```js
173173
const observer = new IntersectionObserver(callback, options);
174174
fragmentRef.current.observeUsing(observer);
175175
```
176176

177-
##### Parameters {/*observeusing-parameters*/}
177+
##### 매개변수 {/*observeusing-parameters*/}
178178

179-
* `observer`: An [`IntersectionObserver`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver) or [`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) instance.
179+
* `observer`: [`IntersectionObserver`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver) 또는 [`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) 인스턴스입니다.
180180

181-
##### Returns {/*observeusing-returns*/}
181+
##### 반환값 {/*observeusing-returns*/}
182182

183-
`observeUsing` does not return anything (`undefined`).
183+
`observeUsing`은 아무것도 반환하지 않습니다(`undefined`).
184184

185185
---
186186

187187
#### `unobserveUsing(observer)` {/*unobserveusing*/}
188188

189-
Stops observing the Fragment's DOM children with the specified observer.
189+
지정된 옵저버를 사용한 Fragment 자식 DOM에 대한 관찰을 중지합니다.
190190

191191
```js
192192
fragmentRef.current.unobserveUsing(observer);
193193
```
194194

195-
##### Parameters {/*unobserveusing-parameters*/}
195+
##### 매개변수 {/*unobserveusing-parameters*/}
196196

197-
* `observer`: The same `IntersectionObserver` or `ResizeObserver` instance previously passed to [`observeUsing`](#observeusing).
197+
* `observer`: 이전에 [`observeUsing`](#observeusing)에 전달했던 것과 동일한 `IntersectionObserver` 또는 `ResizeObserver` 인스턴스입니다.
198198

199-
##### Returns {/*unobserveusing-returns*/}
199+
##### 반환값 {/*unobserveusing-returns*/}
200200

201-
`unobserveUsing` does not return anything (`undefined`).
201+
`unobserveUsing`은 아무것도 반환하지 않습니다(`undefined`).
202202

203203
---
204204

205205
#### `getClientRects()` {/*getclientrects*/}
206206

207-
Returns a flat array of [`DOMRect`](https://developer.mozilla.org/en-US/docs/Web/API/DOMRect) objects representing the bounding rectangles of all first-level DOM children.
207+
모든 1단계 자식 DOM의 경계 사각형을 나타내는 [`DOMRect`](https://developer.mozilla.org/en-US/docs/Web/API/DOMRect) 객체의 평탄한 배열을 반환합니다.
208208

209209
```js
210210
const rects = fragmentRef.current.getClientRects();
211211
```
212212

213-
##### Returns {/*getclientrects-returns*/}
213+
##### 반환값 {/*getclientrects-returns*/}
214214

215-
An `Array<DOMRect>` containing the bounding rectangles of all children.
215+
모든 자식의 경계 사각형이 포함된 `Array<DOMRect>`입니다.
216216

217217
---
218218

219219
#### `getRootNode(options?)` {/*getrootnode*/}
220220

221-
Returns the root node containing the Fragment's parent DOM node, matching the behavior of [`Node.getRootNode()`](https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode).
221+
[`Node.getRootNode()`](https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode) 동작과 일치하게 Fragment의 상위 DOM 노드를 포함하는 루트 노드를 반환합니다.
222222

223223
```js
224224
const root = fragmentRef.current.getRootNode();
225225
```
226226

227-
##### Parameters {/*getrootnode-parameters*/}
227+
##### 매개변수 {/*getrootnode-parameters*/}
228228

229-
* **optional** `options`: An object with a `composed` boolean property, matching the [DOM `getRootNode` API.](https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode#options)
229+
* **선택사항** `options`: [DOM `getRootNode` API](https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode#options)와 일치하는 `composed` 불리언 프로퍼티를 가진 객체입니다.
230230

231-
##### Returns {/*getrootnode-returns*/}
231+
##### 반환값 {/*getrootnode-returns*/}
232232

233-
A `Document`, `ShadowRoot`, or the `FragmentInstance` itself if there is no parent DOM node.
233+
`Document`, `ShadowRoot`, 또는 상위 DOM 노드가 없는 경우 `FragmentInstance` 자체를 반환합니다.
234234

235235
---
236236

237237
#### `compareDocumentPosition(otherNode)` {/*comparedocumentposition*/}
238238

239-
Compares the document position of the Fragment with another node, returning a bitmask matching the behavior of [`Node.compareDocumentPosition()`](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition).
239+
Fragment의 문서 위치를 다른 노드와 비교하여 [`Node.compareDocumentPosition()`](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition) 동작과 일치하는 비트마스크를 반환합니다.
240240

241241
```js
242242
const position = fragmentRef.current.compareDocumentPosition(otherElement);
243243
```
244244

245-
##### Parameters {/*comparedocumentposition-parameters*/}
245+
##### 매개변수 {/*comparedocumentposition-parameters*/}
246246

247-
* `otherNode`: The DOM node to compare against.
247+
* `otherNode`: 비교 대상이 되는 DOM 노드입니다.
248248

249-
##### Returns {/*comparedocumentposition-returns*/}
249+
##### 반환값 {/*comparedocumentposition-returns*/}
250250

251-
A bitmask of [position flags](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition#return_value). Empty Fragments and Fragments with children rendered through a [portal](/reference/react-dom/createPortal) include `Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC` in the result.
251+
[위치 플래그](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition#return_value) 비트마스크입니다. 빈 Fragment 및 [포털](/reference/react-dom/createPortal)을 통해 렌더링된 자식이 있는 Fragment는 결과에 `Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC`을 포함합니다.
252252

253253
---
254254

255255
#### `scrollIntoView(alignToTop?)` {/*scrollintoview*/}
256256

257-
Scrolls the Fragment's children into view. When `alignToTop` is `true` or omitted, scrolls to align the first child with the top of the scrollable ancestor. When `alignToTop` is `false`, scrolls to align the last child with the bottom.
257+
Fragment의 자식이 화면에 보이도록 스크롤합니다. `alignToTop`이 `true`이거나 생략된 경우 스크롤 가능한 상위 요소의 상단에 첫 번째 자식이 맞춰지도록 스크롤합니다. `alignToTop`이 `false`인 경우 하단에 마지막 자식이 맞춰지도록 스크롤합니다.
258258

259259
```js
260260
fragmentRef.current.scrollIntoView();
261261
```
262262

263-
##### Parameters {/*scrollintoview-parameters*/}
263+
##### 매개변수 {/*scrollintoview-parameters*/}
264264

265-
* **optional** `alignToTop`: A boolean. If `true` (the default), scrolls the first child to the top of the scrollable area. If `false`, scrolls the last child to the bottom. Unlike [`Element.scrollIntoView()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView), this method does not accept a `ScrollIntoViewOptions` object.
265+
* **선택사항** `alignToTop`: 불리언입니다. `true`(기본값)이면 스크롤 가능한 영역의 상단으로 첫 번째 자식을 스크롤합니다. `false`이면 하단으로 마지막 자식을 스크롤합니다. [`Element.scrollIntoView()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)와 달리 이 메서드는 `ScrollIntoViewOptions` 객체를 허용하지 않습니다.
266266

267-
##### Returns {/*scrollintoview-returns*/}
267+
##### 반환값 {/*scrollintoview-returns*/}
268268

269-
`scrollIntoView` does not return anything (`undefined`).
269+
`scrollIntoView`는 아무것도 반환하지 않습니다(`undefined`).
270270

271-
##### Caveats {/*scrollintoview-caveats*/}
271+
##### 주의 사항 {/*scrollintoview-caveats*/}
272272

273-
* `scrollIntoView` does not accept an options object. Passing one throws an error. Use the `alignToTop` boolean instead.
274-
* When the Fragment has no children, `scrollIntoView` scrolls the nearest sibling or parent into view as a fallback.
273+
* `scrollIntoView`는 옵션 객체를 허용하지 않습니다. 옵션 객체를 전달하면 오류가 발생합니다. 대신 `alignToTop` 불리언을 사용하세요.
274+
* Fragment에 자식이 없는 경우, `scrollIntoView`는 폴백으로 가장 가까운 형제 또는 상위 요소를 화면에 보이도록 스크롤합니다.
275275

276276
---
277277

278-
#### `FragmentInstance` Caveats {/*fragmentinstance-caveats*/}
278+
#### `FragmentInstance` 주의 사항 {/*fragmentinstance-caveats*/}
279279

280-
* Methods that target children (such as `addEventListener`, `observeUsing`, and `getClientRects`) operate on *first-level host (DOM) children* of the Fragment. They do not directly target children nested inside another DOM element.
281-
* `focus` and `focusLast` search nested children depth-first for focusable elements, unlike event and observer methods which only target first-level host children.
282-
* `observeUsing` does not work on text nodes. React logs a warning in development if the Fragment contains only text children.
283-
* React does not apply event listeners added via `addEventListener` to hidden [`<Activity>`](/reference/react/Activity) trees. When an `Activity` boundary switches from hidden to visible, listeners are applied automatically.
284-
* Each first-level DOM child of a Fragment with a `ref` gets a `reactFragments` property—a `Set<FragmentInstance>` containing all Fragment instances that own the element. This enables [caching a shared observer](#caching-global-intersection-observer) across multiple Fragments.
280+
* 자식을 대상으로 하는 메서드(예: `addEventListener`, `observeUsing`, `getClientRects`)는 Fragment의 *1단계 호스트(DOM) 자식*에서 작동합니다. 다른 DOM 엘리먼트 내에 중첩된 자식을 직접 대상으로 하지 않습니다.
281+
* `focus` 및 `focusLast`는 1단계 호스트 자식만을 대상으로 하는 이벤트 및 옵저버 메서드와 달리, 포커스 가능한 엘리먼트를 찾기 위해 중첩된 자식을 깊이 우선으로 탐색합니다.
282+
* `observeUsing`은 텍스트 노드에서 작동하지 않습니다. Fragment에 텍스트 자식만 포함된 경우 React는 개발 환경에서 경고를 기록합니다.
283+
* React는 숨겨진 [`<Activity>`](/reference/react/Activity) 트리에 `addEventListener`로 추가된 이벤트 리스너를 적용하지 않습니다. `Activity` 경계가 숨김에서 표시로 전환되면 리스너가 자동으로 적용됩니다.
284+
* `ref`가 있는 Fragment의 각 1단계 자식 DOM은 해당 엘리먼트를 소유한 모든 Fragment 인스턴스를 포함하는 `Set<FragmentInstance>`인 `reactFragments` 프로퍼티를 갖습니다. 이를 통해 여러 Fragment에 걸쳐 [공유 옵저버를 캐싱](#caching-global-intersection-observer)할 수 있습니다.
285285

286286
---
287287

0 commit comments

Comments
 (0)