Skip to content

Commit f3fea30

Browse files
committed
docs: resolve conflicts
1 parent 2d364b5 commit f3fea30

21 files changed

+92
-1106
lines changed

src/content/learn/manipulating-the-dom-with-refs.md

Lines changed: 6 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -318,31 +318,6 @@ li {
318318
key={cat.id}
319319
ref={node => {
320320
const map = getMap();
321-
<<<<<<< HEAD
322-
if (node) {
323-
// Map에 노드를 추가합니다
324-
map.set(cat, node);
325-
} else {
326-
// Map에서 노드를 제거합니다
327-
map.delete(cat);
328-
}
329-
}}
330-
>
331-
```
332-
333-
위 방법으로 이후 Map에서 개별적인 DOM 노드를 읽을 수 있습니다.
334-
335-
<Canary>
336-
337-
This example shows another approach for managing the Map with a `ref` callback cleanup function.
338-
339-
```js
340-
<li
341-
key={cat.id}
342-
ref={node => {
343-
const map = getMap();
344-
=======
345-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
346321
// Add to the Map
347322
map.set(cat, node);
348323

@@ -368,11 +343,10 @@ Read more about [how this helps find bugs](/reference/react/StrictMode#fixing-bu
368343

369344
## 다른 컴포넌트의 DOM 노드 접근하기 {/*accessing-another-components-dom-nodes*/}
370345

371-
<<<<<<< HEAD
372346
`<input />`같은 브라우저 요소를 출력하는 내장 컴포넌트에 ref를 주입할 때 React는 ref의 `current` 프로퍼티를 그에 해당하는 (브라우저의 실제 `<input />` 같은) DOM 노드로 설정합니다.
373347

374348
하지만 `<MyInput />` 같이 **직접 만든** 컴포넌트에 ref를 주입할 때는 `null`이 기본적으로 주어집니다. 여기 앞서 말한 내용을 설명하는 예시가 있습니다. 버튼을 클릭할 때 input 요소에 포커스 **되지 않는 것을** 주목하세요.
375-
=======
349+
376350
<Pitfall>
377351
Refs are an escape hatch. Manually manipulating _another_ component's DOM nodes can make your code fragile.
378352
</Pitfall>
@@ -395,7 +369,6 @@ function MyForm() {
395369
In the above example, a ref is created in the parent component, `MyForm`, and is passed to the child component, `MyInput`. `MyInput` then passes the ref to `<input>`. Because `<input>` is a [built-in component](/reference/react-dom/components/common) React sets the `.current` property of the ref to the `<input>` DOM element.
396370

397371
The `inputRef` created in `MyForm` now points to the `<input>` DOM element returned by `MyInput`. A click handler created in `MyForm` can access `inputRef` and call `focus()` to set the focus on `<input>`.
398-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
399372

400373
<Sandpack>
401374

@@ -426,88 +399,18 @@ export default function MyForm() {
426399

427400
</Sandpack>
428401

429-
<<<<<<< HEAD
430-
문제를 인지할 수 있도록, React는 콘솔에 오류 메시지를 출력합니다.
431-
432-
<ConsoleBlock level="error">
433-
434-
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
435-
436-
</ConsoleBlock>
437-
438-
React는 기본적으로 다른 컴포넌트의 DOM 노드에 접근하는 것을 허용하지 않습니다. 컴포넌트의 자식도 예외는 아닙니다! 이것은 의도적인 설계입니다. Ref는 자제해서 사용해야 하는 탈출구입니다. 직접 다른 컴포넌트의 DOM 노드를 조작하는 것은 코드가 쉽게 깨지게 만듭니다.
439-
440-
대신 특정 컴포넌트에서 소유한 DOM 노드를 선택적으로 노출할 수 있습니다. 컴포넌트는 자식 중 하나에 ref를 "전달"하도록 지정할 수 있습니다. 여기 `MyInput`이 어떻게 `forwardRef` API를 사용할 수 있는지 살펴보세요.
441-
442-
```js
443-
const MyInput = forwardRef((props, ref) => {
444-
return <input {...props} ref={ref} />;
445-
});
446-
```
447-
448-
작동하는 원리는 다음과 같습니다.
449-
450-
1. `<MyInput ref={inputRef} />`으로 React가 대응되는 DOM 노드를 `inputRef.current`에 대입하도록 설정합니다. 하지만 이것은 전적으로 `MyInput` 컴포넌트의 선택에 달려 있습니다, 기본적으로는 이렇게 동작하지 않습니다.
451-
2. `MyInput` 컴포넌트는 `forwardRef`를 통해 선언되었습니다. 이것은 `props` 다음에 선언된 **두 번째 `ref` 인수를 통해 상위의 `inputRef`를 받을 수 있도록 합니다.**
452-
3. `MyInput`은 자체적으로 수신받은 `ref`를 컴포넌트 내부의 `<input>`으로 전달합니다.
453-
454-
이제 버튼을 클릭하면 input 요소로 포커스가 잘 이동합니다.
455-
456-
<Sandpack>
457-
458-
```js
459-
import { forwardRef, useRef } from 'react';
460-
461-
const MyInput = forwardRef((props, ref) => {
462-
return <input {...props} ref={ref} />;
463-
});
464-
465-
export default function Form() {
466-
const inputRef = useRef(null);
467-
468-
function handleClick() {
469-
inputRef.current.focus();
470-
}
471-
472-
return (
473-
<>
474-
<MyInput ref={inputRef} />
475-
<button onClick={handleClick}>
476-
Focus the input
477-
</button>
478-
</>
479-
);
480-
}
481-
```
482-
483-
</Sandpack>
484-
485-
이 패턴은 디자인 시스템에서 버튼, 입력 요소 등의 저수준 컴포넌트에서 DOM 노드를 전달하기 위해 매우 흔하게 사용됩니다. 반면 폼, 목록 혹은 페이지 섹션 등의 고수준 컴포넌트에서는 의도하지 않은 DOM 구조 의존성 문제를 피하고자 일반적으로 DOM 노드를 노출하지 않습니다.
486-
487-
=======
488-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
489402
<DeepDive>
490403

491404
#### 명령형 처리방식으로 하위 API 노출하기 {/*exposing-a-subset-of-the-api-with-an-imperative-handle*/}
492405

493-
<<<<<<< HEAD
494406
위 예시에서 `MyInput` 컴포넌트는 DOM 입력 요소를 그대로 노출했습니다. 그리고 부모 컴포넌트에서 DOM 노드의 `focus()`를 호출할 수 있게 되었습니다. 하지만 이에 따라 부모 컴포넌트에서 DOM 노드의 CSS 스타일을 직접 변경하는 등의 예상치 못 한 작업을 할 수 있습니다. 몇몇 상황에서는 노출된 기능을 제한하고 싶을 수 있는데, 이 때 `useImperativeHandle`을 사용합니다.
495-
=======
496-
In the above example, the ref passed to `MyInput` is passed on to the original DOM input element. This lets the parent component call `focus()` on it. However, this also lets the parent component do something else--for example, change its CSS styles. In uncommon cases, you may want to restrict the exposed functionality. You can do that with [`useImperativeHandle`](/reference/react/useImperativeHandle):
497-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
407+
408+
In the above example, the ref passed to `MyInput` is passed on to the original DOM input element. This lets the parent component call `focus()` on it. However, this also lets the parent component do something else--for example, change its CSS styles. In uncommon cases, you may want to restrict the exposed functionality. You can do that with [`useImperativeHandle`](/reference/react/useImperativeHandle): {/*TODO*/}
498409

499410
<Sandpack>
500411

501412
```js
502-
<<<<<<< HEAD
503-
import {
504-
forwardRef,
505-
useRef,
506-
useImperativeHandle
507-
} from 'react';
508-
=======
509413
import { useRef, useImperativeHandle } from "react";
510-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
511414

512415
function MyInput({ ref }) {
513416
const realInputRef = useRef(null);
@@ -538,11 +441,9 @@ export default function Form() {
538441

539442
</Sandpack>
540443

541-
<<<<<<< HEAD
542-
여기 `MyInput` 내부의 `realInputRef`는 실제 input DOM 노드를 가지고 있습니다. 하지만 `useImperativeHandle`을 사용하여 React가 ref를 참조하는 부모 컴포넌트에 직접 구성한 객체를 전달하도록 지시합니다. 따라서 `Form` 컴포넌트 안쪽의 `inputRef.current``foucs` 메서드만 가지고 있습니다. 이 경우 ref는 DOM 노드가 아니라 `useImperativeHandle` 호출에서 직접 구성한 객체가 됩니다.
543-
=======
544-
Here, `realInputRef` inside `MyInput` holds the actual input DOM node. However, [`useImperativeHandle`](/reference/react/useImperativeHandle) instructs React to provide your own special object as the value of a ref to the parent component. So `inputRef.current` inside the `Form` component will only have the `focus` method. In this case, the ref "handle" is not the DOM node, but the custom object you create inside [`useImperativeHandle`](/reference/react/useImperativeHandle) call.
545-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
444+
여기 `MyInput` 내부의 `realInputRef`는 실제 input DOM 노드를 가지고 있습니다. 하지만 [`useImperativeHandle`](/reference/react/useImperativeHandle)을 사용하여 React가 ref를 참조하는 부모 컴포넌트에 직접 구성한 객체를 전달하도록 지시합니다. 따라서 `Form` 컴포넌트 안쪽의 `inputRef.current``foucs` 메서드만 가지고 있습니다. 이 경우 ref는 DOM 노드가 아니라 [`useImperativeHandle`](/reference/react/useImperativeHandle) 호출에서 직접 구성한 객체가 됩니다.
445+
446+
Here, `realInputRef` inside `MyInput` holds the actual input DOM node. However, [`useImperativeHandle`](/reference/react/useImperativeHandle) instructs React to provide your own special object as the value of a ref to the parent component. So `inputRef.current` inside the `Form` component will only have the `focus` method. In this case, the ref "handle" is not the DOM node, but the custom object you create inside [`useImperativeHandle`](/reference/react/useImperativeHandle) call. {/*TODO*/}
546447

547448
</DeepDive>
548449

src/content/learn/react-developer-tools.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,33 +52,10 @@ react-devtools
5252

5353
![React Developer Tools standalone](/images/docs/react-devtools-standalone.png)
5454

55-
<<<<<<< HEAD
56-
## 모바일 (React Native) {/*mobile-react-native*/}
57-
React Developer Tools는 [React Native](https://reactnative.dev/)로 만들어진 앱에서도 잘 동작합니다.
58-
59-
React Developer Tools를 사용하는 가장 쉬운 방법은 전역적으로 설치하는 것입니다.
60-
```bash
61-
# Yarn
62-
yarn global add react-devtools
63-
=======
6455
## Mobile (React Native) {/*mobile-react-native*/}
6556

6657
To inspect apps built with [React Native](https://reactnative.dev/), you can use [React Native DevTools](https://reactnative.dev/docs/react-native-devtools), the built-in debugger that deeply integrates React Developer Tools. All features work identically to the browser extension, including native element highlighting and selection.
67-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
6858

6959
[Learn more about debugging in React Native.](https://reactnative.dev/docs/debugging)
7060

71-
<<<<<<< HEAD
72-
다음으로 터미널에서 개발자 도구를 여십시오.
73-
```bash
74-
react-devtools
75-
```
76-
77-
실행 중인 로컬 React Native 앱에 연결해야 합니다.
78-
79-
> 개발자 도구가 몇 초 후에 연결되지 않으면 앱을 다시 로드해 보십시오.
80-
81-
[React Native 디버깅에 대하여 더 알아보기](https://reactnative.dev/docs/debugging)
82-
=======
8361
> For versions of React Native earlier than 0.76, please use the standalone build of React DevTools by following the [Safari and other browsers](#safari-and-other-browsers) guide above.
84-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc

src/content/reference/react-dom/components/link.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
link: "<link>"
33
---
44

5-
<<<<<<< HEAD
6-
<Canary>
7-
8-
React의 `<link>` 확장은 현재 React의 카나리(Canary) 채널과 실험 채널에서만 사용할 수 있습니다. React의 안정적인 릴리즈에서는 `<link>`[내장 브라우저 HTML 컴포넌트](https://react.dev/reference/react-dom/components#all-html-components)로만 작동합니다. 자세한 내용은 [React 릴리즈 채널](/community/versioning-policy#all-release-channels)에서 확인할 수 있습니다.
9-
10-
</Canary>
11-
12-
=======
13-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
145
<Intro>
156

167
[브라우저 내장 `<link>` 컴포넌트](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)는 스타일시트와 같은 외부 리소스를 사용하거나 링크 메타데이터로 문서를 주석 처리할 수 있게 해줍니다.
@@ -160,13 +151,9 @@ export default function SiteMapPage() {
160151

161152
### 스타일시트 우선순위 제어하기 {/*controlling-stylesheet-precedence*/}
162153

163-
<<<<<<< HEAD
164-
스타일시트는 서로 충돌할 수 있으며, 이 경우 브라우저는 문서에서 나중에 오는 스타일시트를 적용합니다. React는 `precedence` 속성을 사용하여 스타일시트의 순서를 제어할 수 있도록 합니다. 이 예시에서는 두 개의 컴포넌트가 스타일시트를 렌더링하며, 더 높은 우선순위를 가진 스타일시트는 해당 컴포넌트를 더 먼저 렌더링하더라도 문서에서 나중에 배치됩니다.
154+
스타일시트는 서로 충돌할 수 있으며, 이 경우 브라우저는 문서에서 나중에 오는 스타일시트를 적용합니다. React는 `precedence` 속성을 사용하여 스타일시트의 순서를 제어할 수 있도록 합니다. 이 예시에서는 세 개의 컴포넌트가 스타일시트를 렌더링하며, 더 높은 우선순위를 가진 스타일시트는 해당 컴포넌트를 더 먼저 렌더링하더라도 문서에서 나중에 배치됩니다.
165155

166-
{/*FIXME: this doesn't appear to actually work -- I guess precedence isn't implemented yet?*/}
167-
=======
168-
Stylesheets can conflict with each other, and when they do, the browser goes with the one that comes later in the document. React lets you control the order of stylesheets with the `precedence` prop. In this example, three components render stylesheets, and the ones with the same precedence are grouped together in the `<head>`.
169-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
156+
Stylesheets can conflict with each other, and when they do, the browser goes with the one that comes later in the document. React lets you control the order of stylesheets with the `precedence` prop. In this example, three components render stylesheets, and the ones with the same precedence are grouped together in the `<head>`. {/*TODO*/}
170157

171158
<SandpackWithHTMLOutput>
172159

@@ -200,13 +187,9 @@ function ThirdComponent() {
200187

201188
</SandpackWithHTMLOutput>
202189

203-
<<<<<<< HEAD
204-
### 중복으로 제거된 스타일시트 렌더링 {/*deduplicated-stylesheet-rendering*/}
205-
=======
206190
Note the `precedence` values themselves are arbitrary and their naming is up to you. React will infer that precedence values it discovers first are "lower" and precedence values it discovers later are "higher".
207191

208-
### Deduplicated stylesheet rendering {/*deduplicated-stylesheet-rendering*/}
209-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
192+
### 중복으로 제거된 스타일시트 렌더링 {/*deduplicated-stylesheet-rendering*/}
210193

211194
여러 컴포넌트에서 동일한 스타일시트를 렌더링하면 React는 문서의 head에 단일 `<link>`만 배치합니다.
212195

src/content/reference/react-dom/components/meta.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@
22
meta: "<meta>"
33
---
44

5-
<<<<<<< HEAD
6-
<Canary>
7-
8-
React의 `<meta>` 확장은 현재 React의 카나리(Canary) 버전 및 실험 채널에서만 사용할 수 있습니다. React의 안정적인 릴리즈에서는 `<meta>`[내장 브라우저 HTML 컴포넌트](/reference/react-dom/components#all-html-components)로만 작동합니다. 여기에서 [React의 릴리즈 채널](/community/versioning-policy#all-release-channels)에 대해 자세히 알아보십시오.
9-
10-
</Canary>
11-
12-
13-
=======
14-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
155
<Intro>
166

177
[내장 브라우저 `<meta>` 컴포넌트](https://developer.mozilla.org/ko/docs/Web/HTML/Element/meta)를 사용하면 문서에 메타데이터를 추가할 수 있습니다.

src/content/reference/react-dom/components/script.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
script: "<script>"
33
---
44

5-
<<<<<<< HEAD
6-
<Canary>
7-
8-
React의 `<script>` 확장은 현재 React의 카나리(Canary) 버전 및 실험 채널에서만 사용할 수 있습니다. React의 안정적인 릴리즈에서는 `<script>`[내장 브라우저 HTML 컴포넌트](https://react.dev/reference/react-dom/components#all-html-components)로만 작동합니다. 여기에서 [React의 릴리즈 채널](/community/versioning-policy#all-release-channels)에 대해 자세히 알아보십시오.
9-
10-
</Canary>
11-
12-
=======
13-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
145
<Intro>
156

167
[내장 브라우저 `<script>` 컴포넌트](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)를 사용하면 문서에 스크립트를 추가할 수 있습니다.

src/content/reference/react-dom/components/style.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
style: "<style>"
33
---
44

5-
<<<<<<< HEAD
6-
<Canary>
7-
8-
React의 `<title>` 확장은 현재 React의 카나리(Canary) 버전 및 실험 채널에서만 사용할 수 있습니다. React의 안정적인 릴리즈에서는 `<title>`[내장 브라우저 HTML 컴포넌트](/reference/react-dom/components#all-html-components)로만 작동합니다. 여기에서 [React 릴리즈 채널](/community/versioning-policy#all-release-channels)에 대해 자세히 알아보십시오.
9-
10-
</Canary>
11-
12-
=======
13-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
145
<Intro>
156

167
[내장된 브라우저 `<style>` 컴포넌트](https://developer.mozilla.org/ko/docs/Web/HTML/Element/style)를 사용하면 문서에 인라인 CSS 스타일시트를 추가할 수 있습니다.
@@ -72,15 +63,13 @@ React는 `<style>` 컴포넌트를 문서의 `<head>`로 이동시키고, 동일
7263

7364
컴포넌트가 올바르게 표시되기 위해 특정 CSS 스타일에 의존하는 경우, 컴포넌트 내에서 인라인 스타일시트를 렌더링할 수 있습니다.
7465

75-
<<<<<<< HEAD
7666
`href``precedence` 속성을 제공하면 스타일시트가 로딩되는 동안 컴포넌트가 일시 중지됩니다. (인라인 스타일시트의 경우에도 스타일시트가 참조하는 폰트와 이미지로 인해 로딩 시간이 발생할 수 있습니다.) `href` 속성은 스타일시트를 고유하게 식별해야 하며, 이를 통해 React는 동일한 href를 가진 스타일시트의 중복을 제거할 수 있습니다.
77-
=======
67+
7868
The `href` prop should uniquely identify the stylesheet, because React will de-duplicate stylesheets that have the same `href`.
7969
If you supply a `precedence` prop, React will reorder inline stylesheets based on the order these values appear in the component tree.
8070

8171
Inline stylesheets will not trigger Suspense boundaries while they're loading.
82-
Even if they load async resources like fonts or images.
83-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
72+
Even if they load async resources like fonts or images. {/*TODO*/}
8473

8574
<SandpackWithHTMLOutput>
8675

src/content/reference/react-dom/components/title.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@
22
title: "<title>"
33
---
44

5-
<<<<<<< HEAD
6-
<Canary>
7-
8-
React의 `<title>` 확장은 현재 React의 카나리(Canary) 버전 및 실험 채널에서만 사용할 수 있습니다. React의 안정적인 릴리즈에서는 `<title>`[내장 브라우저 HTML 컴포넌트](https://react.dev/reference/react-dom/components#all-html-components)로만 작동합니다. 여기에서 [React 릴리즈 채널](/community/versioning-policy#all-release-channels)에 대해 자세히 알아보십시오.
9-
10-
</Canary>
11-
12-
13-
=======
14-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
155
<Intro>
166

177
[내장된 브라우저 `<title>` 컴포넌트](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title)를 사용하면 문서의 제목을 지정할 수 있습니다.

src/content/reference/react-dom/hooks/index.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,7 @@ title: "Built-in React DOM Hooks"
1212

1313
## 폼 Hooks {/*form-hooks*/}
1414

15-
<<<<<<< HEAD
16-
<Canary>
17-
18-
폼 Hook은 현재 React의 Canary 채널과 실험적인 채널에서만 사용할 수 있습니다. 자세한 내용은 [React 릴리즈 채널](/community/versioning-policy#all-release-channels)에서 확인할 수 있습니다.
19-
20-
</Canary>
21-
2215
**은 정보 제출을 위한 상호 작용형 제어를 만들 수 있도록 해줍니다. 컴포넌트에 있는 폼을 관리하기 위해 다음과 같은 훅 중 하나를 사용할 수 있습니다.
23-
=======
24-
*Forms* let you create interactive controls for submitting information. To manage forms in your components, use one of these Hooks:
25-
>>>>>>> b1a249d597016c6584e4c186daa28b180cc9aafc
2616

2717
* [`useFormStatus`](/reference/react-dom/hooks/useFormStatus) 폼의 상태에 따라 UI를 업데이트할 수 있게 해줍니다.
2818

0 commit comments

Comments
 (0)