Skip to content

Commit 59eec49

Browse files
authored
Merge pull request #867 from ianreas/translate-startTransition
Translate startTransition
2 parents 52a5554 + 1ea464b commit 59eec49

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed
+24-24
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: startTransition
2+
Заголовок: startTransition
33
---
44

55
<Intro>
66

7-
`startTransition` lets you update the state without blocking the UI.
7+
`startTransition` позволяет обновлять состояние без блокировки интерфейса.
88

99
```js
1010
startTransition(scope)
@@ -16,11 +16,11 @@ startTransition(scope)
1616

1717
---
1818

19-
## Reference {/*reference*/}
19+
## Справочник {/*reference*/}
2020

2121
### `startTransition(scope)` {/*starttransitionscope*/}
2222

23-
The `startTransition` function lets you mark a state update as a transition.
23+
Функция `startTransition` позволяет пометить обновление состояния как переход.
2424

2525
```js {7,9}
2626
import { startTransition } from 'react';
@@ -37,37 +37,37 @@ function TabContainer() {
3737
}
3838
```
3939

40-
[See more examples below.](#usage)
40+
[См. другие примеры ниже.](#usage)
4141

42-
#### Parameters {/*parameters*/}
42+
#### Параметры {/*parameters*/}
4343

44-
* `scope`: A function that updates some state by calling one or more [`set` functions.](/reference/react/useState#setstate) React immediately calls `scope` with no parameters and marks all state updates scheduled synchronously during the `scope` function call as transitions. They will be [non-blocking](/reference/react/useTransition#marking-a-state-update-as-a-non-blocking-transition) and [will not display unwanted loading indicators.](/reference/react/useTransition#preventing-unwanted-loading-indicators)
44+
* `scope`: Функция, которая обновляет состояние, вызывая одну или несколько [функций `set`.](/reference/react/useState#setstate) React немедленно вызывает `scope` без параметров и помечает все обновления состояния, запланированные синхронно во время вызова функции scope, как переходы. Они будут [неблокирующими](/reference/react/useTransition#marking-a-state-update-as-a-non-blocking-transition) и [не будут отображать нежелательные индикаторы загрузки.](/reference/react/useTransition#preventing-unwanted-loading-indicators)
4545

46-
#### Returns {/*returns*/}
46+
#### Возвращаемое значение {/*returns*/}
4747

48-
`startTransition` does not return anything.
48+
`startTransition` ничего не возвращает.
4949

50-
#### Caveats {/*caveats*/}
50+
#### Замечания {/*caveats*/}
5151

52-
* `startTransition` does not provide a way to track whether a transition is pending. To show a pending indicator while the transition is ongoing, you need [`useTransition`](/reference/react/useTransition) instead.
52+
* `startTransition` не предоставляет способа отслеживать, ожидает ли переход выполнения. Чтобы показать индикатор ожидания во время выполнения перехода, необходимо использовать [`useTransition`](/reference/react/useTransition).
5353

54-
* You can wrap an update into a transition only if you have access to the `set` function of that state. If you want to start a transition in response to some prop or a custom Hook return value, try [`useDeferredValue`](/reference/react/useDeferredValue) instead.
54+
* Вы можете обернуть обновление в переход только в том случае, если у вас есть доступ к функции `set` для этого состояния. Если вы хотите начать переход в ответ на какой-то проп или значение, возвращаемое пользовательским хуком, попробуйте использовать [`useDeferredValue`](/reference/react/useDeferredValue).
5555

56-
* The function you pass to `startTransition` must be synchronous. React immediately executes this function, marking all state updates that happen while it executes as transitions. If you try to perform more state updates later (for example, in a timeout), they won't be marked as transitions.
56+
* Функция, передаваемая в `startTransition`, должна быть синхронной. React немедленно выполняет эту функцию, помечая как переходы все обновления состояния которые происходят во время ее выполнения. Если вы попытаетесь выполнить дополнительные обновления состояния позже (например, в таймауте), они не будут помечены как переходы.
5757

58-
* A state update marked as a transition will be interrupted by other state updates. For example, if you update a chart component inside a transition, but then start typing into an input while the chart is in the middle of a re-render, React will restart the rendering work on the chart component after handling the input state update.
58+
* Обновление состояния, помеченное как переход, будет прервано другими обновлениями состояния. Например, если вы обновите компонент диаграммы внутри перехода, но затем начнете вводить текст в поле ввода, пока диаграмма находится в процессе повторного рендеринга, React перезапустит процесс рендеринга компонента диаграммы после обработки обновления состояния в поле ввода.
5959

60-
* Transition updates can't be used to control text inputs.
60+
* Обновления перехода не могут использоваться для управления текстовыми полями ввода.
6161

62-
* If there are multiple ongoing transitions, React currently batches them together. This is a limitation that will likely be removed in a future release.
62+
* В случае наличия нескольких одновременных переходов, React в настоящее время группирует их вместе. Это ограничение, вероятно, будет устранено в будущих релизах.
6363

6464
---
6565

66-
## Usage {/*usage*/}
66+
## Применение {/*usage*/}
6767

68-
### Marking a state update as a non-blocking transition {/*marking-a-state-update-as-a-non-blocking-transition*/}
68+
### Пометка обновления состояния как неблокирующего перехода. {/*marking-a-state-update-as-a-non-blocking-transition*/}
6969

70-
You can mark a state update as a *transition* by wrapping it in a `startTransition` call:
70+
Вы можете пометить обновление состояния как *переход*, обернув его в вызов `startTransition`:
7171

7272
```js {7,9}
7373
import { startTransition } from 'react';
@@ -84,14 +84,14 @@ function TabContainer() {
8484
}
8585
```
8686

87-
Transitions let you keep the user interface updates responsive even on slow devices.
87+
Переходы позволяют сохранить отзывчивость обновлений интерфейса даже на медленных устройствах.
8888

89-
With a transition, your UI stays responsive in the middle of a re-render. For example, if the user clicks a tab but then change their mind and click another tab, they can do that without waiting for the first re-render to finish.
89+
С помощью перехода ваш UI остается отзывчивым даже во время повторного рендера. Например, если пользователь нажимает на вкладку, но затем меняет свое решение и нажимает на другую вкладку, он может это сделать, не дожидаясь завершения первого перерендеринга.
9090

9191
<Note>
9292

93-
`startTransition` is very similar to [`useTransition`](/reference/react/useTransition), except that it does not provide the `isPending` flag to track whether a transition is ongoing. You can call `startTransition` when `useTransition` is not available. For example, `startTransition` works outside components, such as from a data library.
93+
`startTransition` очень похож на [`useTransition`](/reference/react/useTransition), за исключением того, что он не предоставляет флаг `isPending` для отслеживания того, идет ли в данный момент переход. Вы можете вызвать `startTransition`, когда `useTransition` недоступен. Например, `startTransition` работает вне компонентов из например, библиотеки данных.
9494

95-
[Learn about transitions and see examples on the `useTransition` page.](/reference/react/useTransition)
95+
[Узнайте о переходах и посмотрите примеры на странице `useTransition`.](/reference/react/useTransition)
9696

97-
</Note>
97+
</Note>

0 commit comments

Comments
 (0)