Skip to content

Commit 7147f9b

Browse files
authored
Translate refs-must-have-owner (#69)
1 parent b7c01cd commit 7147f9b

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

Diff for: content/warnings/refs-must-have-owner.md

+24-20
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,49 @@ layout: single
44
permalink: warnings/refs-must-have-owner.html
55
---
66

7-
You are probably here because you got one of the following error messages:
7+
다음 오류 메시지 중 하나가 나왔기 때문에 여기에 있을 것입니다.
88

99
*React 16.0.0+*
10-
> Warning:
10+
> 경고
1111
>
1212
> 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)
1315
14-
*earlier versions of React*
15-
> Warning:
16+
*이전 버전의 React*
17+
> 경고
1618
>
1719
> 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가 여러 개 로딩됐을 수 있습니다.
1822
19-
This usually means one of three things:
23+
이것은 일반적으로 다음 세 가지 중 하나를 의미합니다.
2024

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 의존성 때문에)
2428

25-
## Refs on Function Components {#refs-on-function-components}
29+
## 함수 컴포넌트에서의 refs {#refs-on-function-components}
2630

27-
If `<Foo>` is a function component, you can't add a ref to it:
31+
`<Foo>`가 함수 컴포넌트인 경우 ref를 추가할 수 없습니다.
2832

2933
```js
30-
// Doesn't work if Foo is a function!
34+
// Foo가 함수 컴포넌트인 경우 작동하지 않습니다!
3135
<Foo ref={foo} />
3236
```
3337

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를 사용하지 않는 것이 좋습니다.
3539

36-
## Strings Refs Outside the Render Method {#strings-refs-outside-the-render-method}
40+
## render 메서드 외부에서의 문자열 refs {#strings-refs-outside-the-render-method}
3741

38-
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` 메서드 내부에서 생성되지 않았다는 것입니다) 예를 들어, 다음은 작동하지 않습니다.
3943

4044
```js
41-
// Doesn't work!
45+
// 작동하지 않습니다!
4246
ReactDOM.render(<App ref="app" />, el);
4347
```
4448

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를 사용할 수도 있습니다.
4650

4751
```js
4852
let app;
@@ -54,10 +58,10 @@ ReactDOM.render(
5458
);
5559
```
5660

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) 생각해보세요.
5862

59-
## Multiple copies of React {#multiple-copies-of-react}
63+
## 여러 개의 React {#multiple-copies-of-react}
6064

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을 통해 서드파티 모듈을 가져오면 의존성 라이브러리에 중복된 사본이 생성되어 문제가 발생할 수 있습니다.
6266

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

Comments
 (0)