You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/getting-started.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ React 문서는 Javascript 프로그래밍에 익숙한 사람을 대상으로
99
99
100
100
### 고급 개념 {#advanced-concepts}
101
101
102
-
[주요 개념](#main-concepts)에 익숙해지고 React를 더 많이 다루게 되면 보다 고급 주제에 관심을 가지게 될 것입니다. 이 섹션에서는 [context](/docs/context.html) 및 [refs](/docs/refs-and-dom.html)와 같이 강력하지만 일반적으로 사용되지는 않는 React 기능을 소개합니다.
102
+
[주요 개념](/docs/hello-world.html)에 익숙해지고 React를 더 많이 다루게 되면 보다 고급 주제에 관심을 가지게 될 것입니다. 이 섹션에서는 [context](/docs/context.html) 및 [refs](/docs/refs-and-dom.html)와 같이 강력하지만 일반적으로 사용되지는 않는 React 기능을 소개합니다.
Copy file name to clipboardExpand all lines: content/docs/hooks-faq.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -209,7 +209,7 @@ There are a few more heuristics, and they might change over time as we fine-tune
209
209
210
210
*`componentDidCatch` and `getDerivedStateFromError`: There are no Hook equivalents for these methods yet, but they will be added soon.
211
211
212
-
### How can I do data fetching with Hooks?
212
+
### How can I do data fetching with Hooks? {#how-can-i-do-data-fetching-with-hooks}
213
213
214
214
Here is a [small demo](https://codesandbox.io/s/jvvkoo8pq3) to get you started. To learn more, check out [this article](https://www.robinwieruch.de/react-hooks-fetch-data/) about data fetching with Hooks.
215
215
@@ -654,7 +654,7 @@ function ProductDetails({ fetchProduct })
654
654
655
655
Note that in the above example we **need** to keep the function in the dependencies list. This ensures that a change in the `productId` prop of `ProductPage` automatically triggers a refetch in the `ProductDetails` component.
656
656
657
-
### What can I do if my effect dependencies change too often?
657
+
### What can I do if my effect dependencies change too often? {#what-can-i-do-if-my-effect-dependencies-change-too-often}
658
658
659
659
Sometimes, your effect may be using reading state that changes too often. You might be tempted to omit that state from a list of dependencies, but that usually leads to bugs:
Copy file name to clipboardExpand all lines: content/warnings/refs-must-have-owner.md
+24-20
Original file line number
Diff line number
Diff line change
@@ -4,45 +4,49 @@ layout: single
4
4
permalink: warnings/refs-must-have-owner.html
5
5
---
6
6
7
-
You are probably here because you got one of the following error messages:
7
+
다음 오류 메시지 중 하나가 나왔기 때문에 여기에 있을 것입니다.
8
8
9
9
*React 16.0.0+*
10
-
> Warning:
10
+
> 경고
11
11
>
12
12
> Element ref was specified as a string (myRefName) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner).
13
+
>
14
+
> 엘리먼트의 ref가 문자열 (myRefName)로 지정되었지만, 소유자가 설정되지 않았습니다. 여러 개의 React가 로딩됐을 수 있습니다. (자세히 알아보기. https://fb.me/react-refs-must-have-owner)
13
15
14
-
*earlier versions of React*
15
-
> Warning:
16
+
*이전 버전의 React*
17
+
> 경고
16
18
>
17
19
> addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded.
20
+
>
21
+
> addComponentAsRefTo(...): ReactOwner만 refs를 가질 수 있습니다. 컴포넌트의 `render` 메서드 안에 생성되지 않은 컴포넌트에 ref를 추가하거나, React가 여러 개 로딩됐을 수 있습니다.
18
22
19
-
This usually means one of three things:
23
+
이것은 일반적으로 다음 세 가지 중 하나를 의미합니다.
20
24
21
-
-You are trying to add a `ref` to a function component.
22
-
-You are trying to add a`ref` to an element that is being created outside of a component's render() function.
23
-
-You have multiple (conflicting) copies of React loaded (eg. due to a misconfigured npm dependency)
25
+
-함수 컴포넌트에 `ref`를 추가하려고 했을 경우입니다.
26
+
-컴포넌트의 render() 함수 외부에서 생성되는 엘리먼트에`ref`를 추가하려고 했을 경우입니다.
27
+
-여러 개의 (충돌하는) React가 있습니다. (예시. 잘못 설정된 npm 의존성 때문에)
24
28
25
-
## Refs on Function Components {#refs-on-function-components}
29
+
## 함수 컴포넌트에서의 refs {#refs-on-function-components}
26
30
27
-
If `<Foo>` is a function component, you can't add a ref to it:
31
+
`<Foo>`가 함수 컴포넌트인 경우 ref를 추가할 수 없습니다.
28
32
29
33
```js
30
-
//Doesn't work if Foo is a function!
34
+
//Foo가 함수 컴포넌트인 경우 작동하지 않습니다!
31
35
<Foo ref={foo} />
32
36
```
33
37
34
-
If you need to add a ref to a component, convert it to a class first, or consider not using refs as they are [rarely necessary](/docs/refs-and-the-dom.html#when-to-use-refs).
38
+
컴포넌트에 ref를 추가해야 하는 경우 먼저 클래스로 컴포넌트로 변경하거나 refs가 필요한 경우가 [거의 없으므로](/docs/refs-and-the-dom.html#when-to-use-refs) ref를 사용하지 않는 것이 좋습니다.
35
39
36
-
## Strings Refs Outside the Render Method {#strings-refs-outside-the-render-method}
This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). For example, this won't work:
42
+
이것은 일반적으로 소유자가 없는 컴포넌트에 ref를 추가하려는 것입니다. (즉, 다른 컴포넌트의 `render` 메서드 내부에서 생성되지 않았다는 것입니다) 예를 들어, 다음은 작동하지 않습니다.
39
43
40
44
```js
41
-
//Doesn't work!
45
+
//작동하지 않습니다!
42
46
ReactDOM.render(<App ref="app"/>, el);
43
47
```
44
48
45
-
Try rendering this component inside of a new top-level component which will hold the ref. Alternatively, you may use a callback ref:
49
+
이 컴포넌트를 ref를 소유할 새로운 최상위 컴포넌트 안에 렌더링해 보세요. 또는 콜백 ref를 사용할 수도 있습니다.
46
50
47
51
```js
48
52
let app;
@@ -54,10 +58,10 @@ ReactDOM.render(
54
58
);
55
59
```
56
60
57
-
Consider if you [really need a ref](/docs/refs-and-the-dom.html#when-to-use-refs)before using this approach.
61
+
이 방법을 사용하기 전에 [정말 ref가 필요한지](/docs/refs-and-the-dom.html#when-to-use-refs)생각해보세요.
58
62
59
-
## Multiple copies of React {#multiple-copies-of-react}
63
+
## 여러 개의 React {#multiple-copies-of-react}
60
64
61
-
Bower does a good job of deduplicating dependencies, but npm does not. If you aren't doing anything (fancy) with refs, there is a good chance that the problem is not with your refs, but rather an issue with having multiple copies of React loaded into your project. Sometimes, when you pull in a third-party module via npm, you will get a duplicate copy of the dependency library, and this can create problems.
65
+
Bower는 의존성 중복 제거 작업을 잘하지만 npm은 그렇지 않습니다. refs로 특별한 일을 하는 게 아니라면, refs 문제가 아니라는 좋은 징조입니다. 그보다는 오히려 여러 개의 React가 프로젝트에 로딩되는 문제일 가능성이 있습니다. 때에 따라 npm을 통해 서드파티 모듈을 가져오면 의존성 라이브러리에 중복된 사본이 생성되어 문제가 발생할 수 있습니다.
62
66
63
-
If you are using npm... `npm ls` or `npm ls react` might help illuminate.
67
+
npm을 사용한다면... 'npm ls' 또는 'npm ls react'가 이 도움이 될 수 있습니다.
0 commit comments