Skip to content

Commit 7f32355

Browse files
committed
resolve conflicts
1 parent 0e69b7d commit 7f32355

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

src/content/reference/react/startTransition.md

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ startTransition(scope)
2020

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

23-
<<<<<<< HEAD
2423
Функция `startTransition` позволяет пометить обновление состояния как переход.
25-
=======
26-
The `startTransition` function lets you mark a state update as a Transition.
27-
>>>>>>> 97489434323b0c4cce78588cd0f48e3808e0eba4
2824

2925
```js {7,9}
3026
import { startTransition } from 'react';
@@ -45,57 +41,33 @@ function TabContainer() {
4541

4642
#### Параметры {/*parameters*/}
4743

48-
<<<<<<< HEAD
49-
* `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)
50-
=======
51-
* `scope`: A function that updates some state by calling one or more [`set` functions.](/reference/react/useState#setstate) React immediately calls `scope` with no arguments 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)
52-
>>>>>>> 97489434323b0c4cce78588cd0f48e3808e0eba4
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)
5345

5446
#### Возвращаемое значение {/*returns*/}
5547

5648
`startTransition` ничего не возвращает.
5749

5850
#### Замечания {/*caveats*/}
5951

60-
<<<<<<< HEAD
6152
* `startTransition` не предоставляет способа отслеживать, ожидает ли переход выполнения. Чтобы показать индикатор ожидания во время выполнения перехода, необходимо использовать [`useTransition`](/reference/react/useTransition).
6253

6354
* Вы можете обернуть обновление в переход только в том случае, если у вас есть доступ к функции `set` для этого состояния. Если вы хотите начать переход в ответ на какой-то проп или значение, возвращаемое пользовательским хуком, попробуйте использовать [`useDeferredValue`](/reference/react/useDeferredValue).
6455

6556
* Функция, передаваемая в `startTransition`, должна быть синхронной. React немедленно выполняет эту функцию, помечая как переходы все обновления состояния которые происходят во время ее выполнения. Если вы попытаетесь выполнить дополнительные обновления состояния позже (например, в таймауте), они не будут помечены как переходы.
6657

6758
* Обновление состояния, помеченное как переход, будет прервано другими обновлениями состояния. Например, если вы обновите компонент диаграммы внутри перехода, но затем начнете вводить текст в поле ввода, пока диаграмма находится в процессе повторного рендеринга, React перезапустит процесс рендеринга компонента диаграммы после обработки обновления состояния в поле ввода.
68-
=======
69-
* `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.
70-
71-
* 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.
72-
73-
* 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.
74-
75-
* 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.
76-
>>>>>>> 97489434323b0c4cce78588cd0f48e3808e0eba4
7759

7860
* Обновления перехода не могут использоваться для управления текстовыми полями ввода.
7961

80-
<<<<<<< HEAD
8162
* В случае наличия нескольких одновременных переходов, React в настоящее время группирует их вместе. Это ограничение, вероятно, будет устранено в будущих релизах.
82-
=======
83-
* If there are multiple ongoing Transitions, React currently batches them together. This is a limitation that will likely be removed in a future release.
84-
>>>>>>> 97489434323b0c4cce78588cd0f48e3808e0eba4
8563

8664
---
8765

8866
## Применение {/*usage*/}
8967

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

9370
Вы можете пометить обновление состояния как *переход*, обернув его в вызов `startTransition`:
94-
=======
95-
### Marking a state update as a non-blocking Transition {/*marking-a-state-update-as-a-non-blocking-transition*/}
96-
97-
You can mark a state update as a *Transition* by wrapping it in a `startTransition` call:
98-
>>>>>>> 97489434323b0c4cce78588cd0f48e3808e0eba4
9971

10072
```js {7,9}
10173
import { startTransition } from 'react';
@@ -114,22 +86,12 @@ function TabContainer() {
11486

11587
Переходы позволяют сохранить отзывчивость обновлений интерфейса даже на медленных устройствах.
11688

117-
<<<<<<< HEAD
11889
С помощью перехода ваш UI остается отзывчивым даже во время повторного рендера. Например, если пользователь нажимает на вкладку, но затем меняет свое решение и нажимает на другую вкладку, он может это сделать, не дожидаясь завершения первого перерендеринга.
11990

12091
<Note>
12192

12293
`startTransition` очень похож на [`useTransition`](/reference/react/useTransition), за исключением того, что он не предоставляет флаг `isPending` для отслеживания того, идет ли в данный момент переход. Вы можете вызвать `startTransition`, когда `useTransition` недоступен. Например, `startTransition` работает вне компонентов из например, библиотеки данных.
12394

12495
[Узнайте о переходах и посмотрите примеры на странице `useTransition`.](/reference/react/useTransition)
125-
=======
126-
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.
127-
128-
<Note>
129-
130-
`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.
131-
132-
[Learn about Transitions and see examples on the `useTransition` page.](/reference/react/useTransition)
133-
>>>>>>> 97489434323b0c4cce78588cd0f48e3808e0eba4
13496

13597
</Note>

0 commit comments

Comments
 (0)