From 60aacaa7df2feb737cbf9ad7eda424a68fa2bb26 Mon Sep 17 00:00:00 2001 From: "translate-react-bot[bot]" <251169733+translate-react-bot[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 15:12:16 +0000 Subject: [PATCH 1/3] =?UTF-8?q?docs:=20translate=20`Activity.md`=20to=20?= =?UTF-8?q?=D0=A0=D1=83=D1=81=D1=81=D0=BA=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/content/reference/react/Activity.md | 82 ++++++++++++------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/src/content/reference/react/Activity.md b/src/content/reference/react/Activity.md index 8b103938e5..a3fb6d5f76 100644 --- a/src/content/reference/react/Activity.md +++ b/src/content/reference/react/Activity.md @@ -5,21 +5,21 @@ version: experimental -**This API is experimental and is not available in a stable version of React yet.** +**Этот API является экспериментальным и еще не доступен в стабильной версии React.** -You can try it by upgrading React packages to the most recent experimental version: +Вы можете попробовать его, обновив пакеты React до последней экспериментальной версии: - `react@experimental` - `react-dom@experimental` - `eslint-plugin-react-hooks@experimental` -Experimental versions of React may contain bugs. Don't use them in production. +Экспериментальные версии React могут содержать ошибки. Не используйте их в продакшене. -`` lets you hide and show part of the UI. +`` позволяет скрывать и показывать часть пользовательского интерфейса. ```js @@ -34,11 +34,11 @@ Experimental versions of React may contain bugs. Don't use them in production. --- -## Reference {/*reference*/} +## Справочник {/*reference*/} ### `` {/*activity*/} -Wrap a part of the UI in `` to manage its visibility state: +Оберните часть пользовательского интерфейса в ``, чтобы управлять состоянием её видимости: ```js import {unstable_Activity as Activity} from 'react'; @@ -48,30 +48,30 @@ import {unstable_Activity as Activity} from 'react'; ``` -When "hidden", the `children` of `` are not visible on the page. If a new `` mounts as "hidden" then it pre-renders the content at lower priority without blocking the visible content on the page, but it does not mount by creating Effects. When a "visible" Activity switches to "hidden" it conceptually unmounts by destroying all the Effects, but saves its state. This allows fast switching between "visible" and "hidden" states without recreating the state for a "hidden" Activity. +Когда `` находится в состоянии "hidden" (`скрыто`), её `children` не отображаются на странице. Если новый `` монтируется в состоянии "hidden", то его содержимое предварительно рендерится с пониженным приоритетом, не блокируя видимый контент на странице, но при этом не монтируются эффекты (Effects). Когда видимая (`visible`) `` переключается в состояние "hidden", она концептуально размонтируется путём уничтожения всех эффектов, но сохраняет своё состояние. Это позволяет быстро переключаться между состояниями "visible" и "hidden" без повторного создания состояния для "hidden" ``. -In the future, "hidden" Activities may automatically destroy state based on resources like memory. +В будущем состояние "hidden" `` может автоматически уничтожаться в зависимости от ресурсов, таких как память. #### Props {/*props*/} -* `children`: The actual UI you intend to render. -* **optional** `mode`: Either "visible" or "hidden". Defaults to "visible". When "hidden", updates to the children are deferred to lower priority. The component will not create Effects until the Activity is switched to "visible". If a "visible" Activity switches to "hidden", the Effects will be destroyed. +* `children`: Реальный UI, который вы хотите отобразить. +* **optional** `mode`: Либо "visible" (`видимый`), либо "hidden" (`скрытый`). По умолчанию "visible". Когда `mode` установлен в "hidden", обновления `children` откладываются до выполнения с пониженным приоритетом. Компонент не будет создавать эффекты (Effects) до тех пор, пока `` не переключится в состояние "visible". Если видимая (`visible`) `` переключается в состояние "hidden", эффекты будут уничтожены. -#### Caveats {/*caveats*/} +#### Ограничения {/*caveats*/} -- While hidden, the `children` of `` are hidden on the page. -- `` will unmount all Effects when switching from "visible" to "hidden" without destroying React or DOM state. This means Effects that are expected to run only once on mount will run again when switching from "hidden" to "visible". Conceptually, "hidden" Activities are unmounted, but they are not destroyed either. We recommend using [``](/reference/react/StrictMode) to catch any unexpected side-effects from this behavior. -- When used with ``, hidden activities that reveal in a transition will activate an "enter" animation. Visible Activities hidden in a transition will activate an "exit" animation. -- Parts of the UI wrapped in `` are not included in the SSR response. -- Parts of the UI wrapped in `` will hydrate at a lower priority than other content. +- Пока `` находится в состоянии "hidden", её `children` скрыты на странице. +- `` размонтирует все эффекты (Effects) при переключении из состояния "visible" в "hidden", не уничтожая состояние React или DOM. Это означает, что эффекты, которые должны выполняться только один раз при монтировании, будут выполнены снова при переключении из состояния "hidden" в "visible". Концептуально, "hidden" `` размонтируются, но не уничтожаются. Мы рекомендуем использовать [``](/reference/react/StrictMode) для отлова любых неожиданных побочных эффектов от такого поведения. +- При использовании с ``, скрытые `` при появлении в переходе будут активировать анимацию "enter". Видимые ``, скрытые в переходе, будут активировать анимацию "exit". +- Части UI, обёрнутые в ``, не включаются в SSR-ответ. +- Части UI, обёрнутые в ``, будут гидратироваться с более низким приоритетом, чем другой контент. --- -## Usage {/*usage*/} +## Использование {/*usage*/} -### Pre-render part of the UI {/*pre-render-part-of-the-ui*/} +### Предварительный рендеринг части UI {/*pre-render-part-of-the-ui*/} -You can pre-render part of the UI using ``: +Вы можете предварительно отрендерить часть UI, используя ``: ```js @@ -79,11 +79,11 @@ You can pre-render part of the UI using ``: ``` -When an Activity is rendered with `mode="hidden"`, the `children` are not visible on the page, but are rendered at lower priority than the visible content on the page. +Когда компонент Activity рендерится с `mode="hidden"`, его `children` не видны на странице, но рендерятся с более низким приоритетом, чем видимый контент. -When the `mode` later switches to "visible", the pre-rendered children will mount and become visible. This can be used to prepare parts of the UI the user is likely to interact with next to reduce loading times. +Когда `mode` позже переключается на "visible", предварительно отрендеренные дочерние элементы монтируются и становятся видимыми. Это можно использовать для подготовки частей UI, с которыми пользователь, вероятно, будет взаимодействовать в дальнейшем, чтобы сократить время загрузки. -In the following example from [`useTransition`](/reference/react/useTransition#preventing-unwanted-loading-indicators), the `PostsTab` component fetches some data using `use`. When you click the “Posts” tab, the `PostsTab` component suspends, causing the button loading state to appear: +В следующем примере из [`useTransition`](/reference/react/useTransition#preventing-unwanted-loading-indicators) компонент `PostsTab` получает данные с помощью `use`. Когда вы нажимаете на вкладку «Posts», компонент `PostsTab` приостанавливается, вызывая появление индикатора загрузки кнопки: @@ -276,9 +276,9 @@ b { display: inline-block; margin-right: 10px; } -In this example, the user needs to wait for the posts to load when clicking on the "Posts" tab. +В этом примере пользователю приходится ждать загрузки постов при нажатии на вкладку «Posts». -We can reduce the delay for the "Posts" tab by pre-rendering the inactive Tabs with a hidden ``: +Мы можем сократить задержку для вкладки «Posts», предварительно отрендерив неактивные вкладки с помощью скрытого ``: @@ -470,10 +470,10 @@ b { display: inline-block; margin-right: 10px; } --- -### Keeping state for part of the UI {/*keeping-state-for-part-of-the-ui*/} +### Сохранение состояния части UI {/*keeping-state-for-part-of-the-ui*/} -You can keep state for parts of the UI by switching `` from "visible" to "hidden": +Вы можете сохранять состояние для частей UI, переключая `` из режима "visible" в "hidden": ```js @@ -481,11 +481,11 @@ You can keep state for parts of the UI by switching `` from "visible" ``` -When an Activity switches from `mode="visible"` to "hidden", the `children` will become hidden on the page, and unmount by destroying all Effects, but will keep their React and DOM state. +Когда компонент Activity переключается из режима `mode="visible"` в "hidden", его `children` скрываются на странице и размонтируются с уничтожением всех эффектов, но сохраняют свое React- и DOM-состояние. -When the `mode` later switches to "visible", the saved state will be re-used when mounting the children by creating all the Effects. This can be used to keep state in parts of the UI the user is likely to interact with again to maintain DOM or React state. +Когда `mode` позже переключается обратно на "visible", сохраненное состояние используется повторно при монтировании дочерних элементов путем создания всех эффектов. Это можно использовать для сохранения состояния в частях UI, с которыми пользователь, вероятно, снова будет взаимодействовать, чтобы сохранить DOM- или React-состояние. -In the following example from [`useTransition`](/reference/react/useTransition#preventing-unwanted-loading-indicators), the `ContactTab` includes a `