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: src/content/learn/add-react-to-an-existing-project.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ title: 기존 프로젝트에 React 추가하기
24
24
2. 사용하는 프레임워크 설정에서 **`/some-app` 을 *기본 경로*<sup>*Base Path*</sup>로 명시하세요**. (이때, [Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath), [Gatsby](https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/path-prefix/)를 사용하세요!)
25
25
3.**서버 또는 프록시를 구성**하여 `/some-app/` 하위의 모든 요청이 React 앱에서 처리되도록 하세요.
26
26
27
-
This ensures the React part of your app can [benefit from the best practices](/learn/build-a-react-app-from-scratch#consider-using-a-framework) baked into those frameworks.
27
+
이렇게 하면 앱의 React 부분이 해당 프레임워크에 [내장된 모범 사례](/learn/build-a-react-app-from-scratch#consider-using-a-framework)의 이점을 누릴 수 있습니다.
28
28
29
29
많은 React 기반의 프레임워크는 풀스택이며 React 앱이 서버를 활용할 수 있도록 합니다. 그러나 서버에서 자바스크립트를 실행할 수 없거나 실행하고 싶지 않은 경우에도 동일한 접근방식을 사용할 수 있습니다. 이러한 경우에는 HTML/CSS/JS 내보내기(Next.js의 경우 [`next export` output](https://nextjs.org/docs/advanced-features/static-html-export), Gatsby의 경우 기본값)를 `/some-app/`에서 대신 제공하세요.
Copy file name to clipboardExpand all lines: src/content/learn/manipulating-the-dom-with-refs.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,7 +211,7 @@ li {
211
211
212
212
이 문제를 해결하는 한 방법은 부모 요소에서 단일 ref를 얻고, [`querySelectorAll`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll)과 같은 DOM 조작 메서드를 사용하여 그 안에서 개별 자식 노드를 "찾는" 것입니다. 하지만 이는 다루기가 힘들며 DOM 구조가 바뀌는 경우 작동하지 않을 수 있습니다.
213
213
214
-
Another solution is to **pass a function to the `ref`attribute.**This is called a [`ref`callback.](/reference/react-dom/components/common#ref-callback) React will call your ref callback with the DOM node when it's time to set the ref, and call the cleanup function returned from the callback when it's time to clear it. This lets you maintain your own array or a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), and access any ref by its index or some kind of ID.
214
+
또 다른 해결책은 **`ref`어트리뷰트에 함수를 전달하는 것입니다.**이것을 [`ref`콜백](/reference/react-dom/components/common#ref-callback)이라 부릅니다. React는 ref를 설정할 때 DOM 노드와 함께 ref 콜백을 호출하고, ref를 지울 때는 콜백에서 반환된 정리 함수를 호출합니다. 이를 통해 배열이나 [Map](https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Map)을 직접 관리하고 인덱스나 특정 ID로 ref에 접근할 수 있습니다.
Copy file name to clipboardExpand all lines: src/content/reference/react/cacheSignal.md
+22-22Lines changed: 22 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@ title: cacheSignal
4
4
5
5
<RSC>
6
6
7
-
`cacheSignal` is currently only used with [React Server Components](/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023#react-server-components).
7
+
`cacheSignal`은 현재 [React 서버 컴포넌트](/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023#react-server-components)에서만 사용할 수 있습니다.
8
8
9
9
</RSC>
10
10
11
11
<Intro>
12
12
13
-
`cacheSignal` allows you to know when the `cache()`lifetime is over.
13
+
`cacheSignal`을 사용하면 `cache()`수명이 언제 끝나는지 알 수 있습니다.
14
14
15
15
```js
16
16
constsignal=cacheSignal();
@@ -22,11 +22,11 @@ const signal = cacheSignal();
22
22
23
23
---
24
24
25
-
## Reference {/*reference*/}
25
+
## 레퍼런스 {/*reference*/}
26
26
27
27
### `cacheSignal` {/*cachesignal*/}
28
28
29
-
Call `cacheSignal` to get an `AbortSignal`.
29
+
`cacheSignal`을 호출하면 `AbortSignal`을 얻을 수 있습니다.
30
30
31
31
```js {3,7}
32
32
import {cacheSignal} from'react';
@@ -35,32 +35,32 @@ async function Component() {
35
35
}
36
36
```
37
37
38
-
When React has finished rendering, the `AbortSignal` will be aborted. This allows you to cancel any in-flight work that is no longer needed.
39
-
Rendering is considered finished when:
40
-
-React has successfully completed rendering
41
-
-the render was aborted
42
-
-the render has failed
38
+
React가 렌더링을 완료하면 `AbortSignal`이 중단됩니다. 이를 통해 더 이상 필요하지 않은 진행 중인 작업을 취소할 수 있습니다.
39
+
렌더링이 완료된 것으로 간주하는 경우는 다음과 같습니다.
40
+
-React가 성공적으로 렌더링을 완료한 경우
41
+
-렌더링이 중단된 경우
42
+
-렌더링이 실패한 경우
43
43
44
-
#### Parameters {/*parameters*/}
44
+
#### 매개변수 {/*parameters*/}
45
45
46
-
This function does not accept any parameters.
46
+
이 함수는 매개변수를 받지 않습니다.
47
47
48
-
#### Returns {/*returns*/}
48
+
#### 반환값 {/*returns*/}
49
49
50
-
`cacheSignal` returns an `AbortSignal` if called during rendering. Otherwise `cacheSignal()` returns `null`.
50
+
`cacheSignal`은 렌더링 중에 호출되면 `AbortSignal`을 반환합니다. 그 외의 경우에 `cacheSignal()`은 `null`을 반환합니다.
51
51
52
-
#### Caveats {/*caveats*/}
52
+
#### 주의사항 {/*caveats*/}
53
53
54
-
-`cacheSignal` is currently for use in [React Server Components](/reference/rsc/server-components) only. In Client Components, it will always return `null`. In the future it will also be used for Client Component when a client cache refreshes or invalidates. You should not assume it'll always be null on the client.
55
-
-If called outside of rendering, `cacheSignal` will return `null` to make it clear that the current scope isn't cached forever.
54
+
-`cacheSignal`은 현재 [React 서버 컴포넌트](/reference/rsc/server-components)에서만 사용할 수 있습니다. 클라이언트 컴포넌트에서는 항상 `null`을 반환합니다. 향후 클라이언트 캐시가 갱신되거나 무효화될 때 클라이언트 컴포넌트에서도 사용될 예정입니다. 클라이언트에서 항상 `null`을 반환한다고 가정하면 안 됩니다.
55
+
-렌더링 외부에서 호출하면 `cacheSignal`은 `null`을 반환하여 현재 스코프가 영원히 캐시되지 않음을 명확히 합니다.
Call <CodeStepstep={1}>`cacheSignal`</CodeStep> to abort in-flight requests.
63
+
<CodeStepstep={1}>`cacheSignal`</CodeStep>을 호출하여 진행 중인 요청을 중단할 수 있습니다.
64
64
65
65
```js [[1, 4, "cacheSignal()"]]
66
66
import {cache, cacheSignal} from'react';
@@ -71,7 +71,7 @@ async function Component() {
71
71
```
72
72
73
73
<Pitfall>
74
-
You can't use `cacheSignal` to abort async work that was started outside of rendering e.g.
74
+
아래의 예시처럼 렌더링 외부에서 시작된 비동기 작업을 `cacheSignal`로 중단할 수 없습니다.
75
75
76
76
```js
77
77
import {cacheSignal} from'react';
@@ -83,9 +83,9 @@ async function Component() {
83
83
```
84
84
</Pitfall>
85
85
86
-
### Ignore errors after React has finished rendering {/*ignore-errors-after-react-has-finished-rendering*/}
86
+
### React가 렌더링을 완료한 후 오류 무시하기 {/*ignore-errors-after-react-has-finished-rendering*/}
87
87
88
-
If a function throws, it may be due to cancellation (e.g. <CodeStepstep={1}>the Database connection</CodeStep> has been closed). You can use the <CodeStepstep={2}>`aborted`property</CodeStep> to check if the error was due to cancellation or a real error. You may want to <CodeStepstep={3}>ignore errors</CodeStep> that were due to cancellation.
88
+
함수가 오류를 던지는 경우 취소로 인한 것일 수 있습니다. (예를 들어, <CodeStepstep={1}>데이터베이스 연결</CodeStep>이 닫힌 경우) <CodeStepstep={2}>`aborted`속성</CodeStep>을 사용하여 오류가 취소로 인한 것인지 실제 오류인지 확인할 수 있습니다. 취소로 인한 <CodeStepstep={3}>오류는 무시할 수 있습니다</CodeStep>.
0 commit comments