Skip to content

Commit 09d144e

Browse files
committed
docs: translate "Activity" section
1 parent bab8637 commit 09d144e

1 file changed

Lines changed: 32 additions & 30 deletions

File tree

src/content/blog/2025/04/23/react-labs-view-transitions-activity-and-more.md

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11466,37 +11466,39 @@ _View Transition을 구축한 배경에 대한 자세한 내용은 다음을 참
1146611466

1146711467
## Activity {/*activity*/}
1146811468

11469-
In [past](/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022#offscreen) [updates](/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024#offscreen-renamed-to-activity), we shared that we were researching an API to allow components to be visually hidden and deprioritized, preserving UI state with reduced performance costs relative to unmounting or hiding with CSS.
11469+
[지난](/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022#offscreen) [업데이트](/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024#offscreen-renamed-to-activity)에서, 컴포넌트를 시각적으로 숨기고 우선순위를 지정 해제할 수 있는 API를 연구 중이며, CSS로 마운트 해제하거나 숨기는 것에 비해 성능 비용을 줄이면서 UI 상태를 유지할 수 있다고 공유한 바 있습니다.
1147011470

11471-
We're now ready to share the API and how it works, so you can start testing it in experimental React versions.
11471+
이제 API와 그 작동 방식을 공유할 준비가 되었고, 실험적인 React 버전에서 테스트를 시작할 수 있습니다.
1147211472

11473-
`<Activity>` is a new component to hide and show parts of the UI:
11473+
`<Activity>`는 UI의 일부를 숨기고 표시하는 새로운 컴포넌트입니다.
1147411474

1147511475
```js [[1, 1, "'visible'"], [2, 1, "'hidden'"]]
1147611476
<Activity mode={isVisible ? 'visible' : 'hidden'}>
1147711477
<Page />
1147811478
</Activity>
1147911479
```
1148011480

11481-
When an Activity is <CodeStep step={1}>visible</CodeStep> it's rendered as normal. When an Activity is <CodeStep step={2}>hidden</CodeStep> it is unmounted, but will save its state and continue to render at a lower priority than anything visible on screen.
11481+
Activity가 <CodeStep step={1}>visible</CodeStep>하면 정상적으로 렌더링됩니다. Activity가 <CodeStep step={2}>hidden</CodeStep>하면 마운트 해제되지만, 상태를 저장하고 화면에 표시되는 항목보다 낮은 우선 순위로 계속 렌더링됩니다.
1148211482

11483-
You can use `Activity` to save state for parts of the UI the user isn't using, or pre-render parts that a user is likely to use next.
11483+
`Activity`를 사용하여 사용자가 사용하지 않는 UI 부분의 상태를 저장하거나 사용자가 다음에 사용할 가능성이 있는 부분을 미리 렌더링할 수 있습니다.
1148411484

11485-
Let's look at some examples improving the View Transition examples above.
11485+
위의 View Transition 예시를 개선한 몇 가지 예시를 살펴보겠습니다.
1148611486

1148711487
<Note>
1148811488

11489-
**Effects don’t mount when an Activity is hidden.**
11489+
**Activity가 숨겨져 있으면 Effects는 마운트되지 않습니다.**
1149011490

11491-
When an `<Activity>` is `hidden`, Effects are unmounted. Conceptually, the component is unmounted, but React saves the state for later.
11491+
`<Activity>``hidden`이면 Effects가 마운트 해제됩니다. 개념적으로는 컴포넌트가 마운트 해제되지만 React는 나중에 사용할 수 있도록 상태를 저장합니다.
1149211492

11493-
In practice, this works as expected if you have followed the [You Might Not Need an Effect](/learn/you-might-not-need-an-effect) guide. To eagerly find problematic Effects, we recommend adding [`<StrictMode>`](/reference/react/StrictMode) which will eagerly perform Activity unmounts and mounts to catch any unexpected side effects.
11493+
In practice, this works as expected if you have followed the [Effect가 필요하지 않은 경우](/learn/you-might-not-need-an-effect) guide. To eagerly find problematic Effects, we recommend adding [`<StrictMode>`](/reference/react/StrictMode) which will eagerly perform Activity unmounts and mounts to catch any unexpected side effects.
11494+
실제로는 [Effect가 필요하지 않은 경우](/learn/you-might-not-need-an-effect) 가이드를 따랐다면 예상대로 작동합니다.
11495+
문제가 있는 Effect를 열심히 찾으려면, 예상치 못한 사이드 이펙트를 발견하기 위해 Activity 마운트 해제와 마운트를 열심히 수행하는 [`<StrictMode>`](/reference/react/StrictMode)를 추가하는 것이 좋습니다.
1149411496

1149511497
</Note>
1149611498

11497-
### Restoring state with Activity {/*restoring-state-with-activity*/}
11499+
### Activity로 상태 복원하기 {/*restoring-state-with-activity*/}
1149811500

11499-
When a user navigates away from a page, it's common to stop rendering the old page:
11501+
사용자가 페이지에서 다른 페이지로 이동하면 이전 페이지의 렌더링을 중단하는 것이 일반적입니다.
1150011502

1150111503
```js {6,7}
1150211504
function App() {
@@ -11511,9 +11513,9 @@ function App() {
1151111513
}
1151211514
```
1151311515

11514-
However, this means if the user goes back to the old page, all of the previous state is lost. For example, if the `<Home />` page has an `<input>` field, when the user leaves the page the `<input>` is unmounted, and all of the text they had typed is lost.
11516+
그러나 이는 사용자가 이전 페이지로 돌아갈 경우 이전 상태는 모두 손실되는 것을 의미합니다. 예를 들어 `<Home />` 페이지에 `<input>` 필드가 있는 경우 사용자가 페이지를 나가면 `<input>`이 마운트 해제되고 입력했던 모든 텍스트가 손실됩니다.
1151511517

11516-
Activity allows you to keep the state around as the user changes pages, so when they come back they can resume where they left off. This is done by wrapping part of the tree in `<Activity>` and toggling the `mode`:
11518+
Activity를 사용하면 사용자가 페이지를 변경할 때 상태를 유지하여, 다시 돌아왔을 때 중단한 부분부터 다시 시작할 수 있습니다. 이 작업은 트리의 일부를 `<Activity>`로 감싸고 `mode`를 전환하면 됩니다.
1151711519

1151811520
```js {6-8}
1151911521
function App() {
@@ -11530,9 +11532,9 @@ function App() {
1153011532
}
1153111533
```
1153211534

11533-
With this change, we can improve on our View Transitions example above. Before, when you searched for a video, selected one, and returned, your search filter was lost. With Activity, your search filter is restored and you can pick up where you left off.
11535+
이 변경으로 위의 View Transition 예시를 개선할 수 있습니다. 이전에는 동영상을 검색하고 선택한 후 돌아오면 검색 필터가 사라졌습니다. Activity를 사용하면 검색 필터가 복원되어 중단한 부분부터 다시 시작할 수 있습니다.
1153411536

11535-
Try searching for a video, selecting it, and clicking "back":
11537+
동영상을 검색하고 선택한 후 "back"을 클릭해 보세요.
1153611538

1153711539
<Sandpack>
1153811540

@@ -12849,11 +12851,11 @@ root.render(
1284912851

1285012852
</Sandpack>
1285112853

12852-
### Pre-rendering with Activity {/*prerender-with-activity*/}
12854+
### Activity로 사전 렌더링하기 {/*prerender-with-activity*/}
1285312855

12854-
Sometimes, you may want to prepare the next part of the UI a user is likely to use ahead of time, so it's ready by the time they are ready to use it. This is especially useful if the next route needs to suspend on data it needs to render, because you can help ensure the data is already fetched before the user navigates.
12856+
사용자가 사용할 가능성이 높은 UI의 다음 부분을 미리 준비하여 그들이 사용할 준비가 되었을 때 바로 사용할 수 있도록 하고 싶을 때가 있습니다. 사용자가 네비게이팅하기 전에 데이터를 이미 가져왔을 수 있으므로, 다음 라우트가 렌더링해야 하는 데이터를 일시 중단해야 하는 경우 특히 유용합니다.
1285512857

12856-
For example, our app currently needs to suspend to load the data for each video when you select one. We can improve this by rendering all of the pages in a hidden `<Activity>` until the user navigates:
12858+
예를 들어, 현재 우리의 앱은 사용자가 동영상을 선택할 때 각 동영상에 대한 데이터를 로드하기 위해 일시 중단해야 합니다. 사용자가 탐색할 때까지 숨겨진 `<Activity>`에 있는 모든 페이지를 렌더링하여 이 문제를 개선할 수 있습니다.
1285712859

1285812860
```js {2,5,8}
1285912861
<ViewTransition>
@@ -12869,7 +12871,7 @@ For example, our app currently needs to suspend to load the data for each video
1286912871
<ViewTransition>
1287012872
```
1287112873

12872-
With this update, if the content on the next page has time to pre-render, it will animate in without the Suspense fallback. Click a video, and notice that the video title and description on the Details page render immediately, without a fallback:
12874+
이 업데이트를 통해 다음 페이지의 콘텐츠가 미리 렌더링할 시간이 있는 경우 Suspense 폴백 없이 애니메이션이 적용됩니다. 동영상을 클릭하면 세부 정보 페이지의 동영상 제목과 설명이 폴백 없이 즉시 렌더링되는 것을 확인할 수 있습니다.
1287312875

1287412876
<Sandpack>
1287512877

@@ -14187,27 +14189,27 @@ root.render(
1418714189

1418814190
</Sandpack>
1418914191

14190-
### Server-Side Rendering with Activity {/*server-side-rendering-with-activity*/}
14192+
### Activity를 사용한 서버 사이드 렌더링 {/*server-side-rendering-with-activity*/}
1419114193

14192-
When using Activity on a page that uses server-side rendering (SSR), there are additional optimizations.
14194+
서버 사이드 렌더링(SSR)을 사용하는 페이지에서 Activity를 사용하는 경우 추가적인 최적화 과정이 있습니다.
1419314195

14194-
If part of the page is rendered with `mode="hidden"`, then it will not be included in the SSR response. Instead, React will schedule a client render for the content inside Activity while the rest of the page hydrates, prioritizing the visible content on screen.
14196+
페이지의 일부가 `mode="hidden"`으로 렌더링되는 경우, 해당 부분은 SSR 응답에 포함되지 않습니다. 대신, React는 페이지의 나머지 부분이 하이드레이션되는 동안 Activity 내부의 콘텐츠에 대한 클라이언트 렌더링을 예약하여 화면에 표시되는 콘텐츠의 우선순위를 정합니다.
1419514197

14196-
For parts of the UI rendered with `mode="visible"`, React will de-prioritize hydration of content within Activity, similar to how Suspense content is hydrated at a lower priority. If the user interacts with the page, we'll prioritize hydration within the boundary if needed.
14198+
`mode="visible"`으로 렌더링된 UI의 일부의 경우, React는 Suspense 콘텐츠가 낮은 우선순위로 하이드레이션되는 것과 유사하게 활동 내 콘텐츠의 하이드레이션 우선순위를 낮춥니다. 사용자가 페이지와 상호작용하는 경우, 필요한 경우 경계 내에서 하이드레이션의 우선순위를 지정합니다.
1419714199

14198-
These are advanced use cases, but they show the additional benefits considered with Activity.
14200+
이는 고급 사용 사례이지만 Activity에서 고려되는 추가적인 이점을 보여줍니다.
1419914201

14200-
### Future modes for Activity {/*future-modes-for-activity*/}
14202+
### 향후 Activity의 모드 {/*future-modes-for-activity*/}
1420114203

14202-
In the future, we may add more modes to Activity.
14204+
향후 Activity에 더 많은 모드를 추가할 수 있습니다.
1420314205

14204-
For example, a common use case is rendering a modal, where the previous "inactive" page is visible behind the "active" modal view. The "hidden" mode does not work for this use case because it's not visible and not included in SSR.
14206+
예를 들어 일반적인 사용 사례는 "활성화된" 모달 뷰 뒤에 이전의 "비활성된" 페이지가 표시되는 모달을 렌더링하는 것입니다. 이 사용 사례에서는 "hidden" 모드가 표시되지 않고 SSR에 포함되지 않기 때문에 작동하지 않습니다.
1420514207

14206-
Instead, we're considering a new mode that would keep the content visible&mdash;and included in SSR&mdash;but keep it unmounted and de-prioritize updates. This mode may also need to "pause" DOM updates, since it can be distracting to see backgrounded content updating while a modal is open.
14208+
대신 콘텐츠를 계속 표시하고 &mdash;SSR에 포함하되&mdash; 마운트되지 않은 상태로 유지하고 업데이트 우선순위를 해제하는 새로운 모드를 고려하고 있습니다. 이 모드는 모달이 열려 있는 동안 백그라운드 콘텐츠가 업데이트되는 것을 보는 것이 방해가 될 수 있으므로, DOM 업데이트를 "일시 중지"해야 할 수도 있습니다.
1420714209

14208-
Another mode we're considering for Activity is the ability to automatically destroy state for hidden Activities if there is too much memory being used. Since the component is already unmounted, it may be preferable to destroy state for the least recently used hidden parts of the app rather than consume too many resources.
14210+
Activity에서 고려 중인 또 다른 모드는 메모리가 너무 많이 사용되는 경우 숨겨진 활동의 상태를 자동으로 삭제하는 기능입니다. 컴포넌트가 이미 마운트 해제된 상태이므로 너무 많은 리소스를 소모하기보다는 앱에서 가장 최근에 사용된 숨겨진 부분의 상태를 파기하는 것이 더 바람직할 수 있습니다.
1420914211

14210-
These are areas we're still exploring, and we'll share more as we make progress. For more information on what Activity includes today, [check out the docs](/reference/react/Activity).
14212+
이 부분은 아직 연구 중인 부분이며, 진전이 있으면 더 많은 내용을 공유해드리겠습니다. 오늘 포함된 Activity에 대한 자세한 내용은 [문서를 참조하세요](/reference/react/Activity).
1421114213

1421214214
---
1421314215

0 commit comments

Comments
 (0)