Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add translated flushSync #1021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dimatitov wants to merge 1 commit into reactjs:main
base: main
Choose a base branch
Loading
from dimatitov:flushSync
Open

Conversation

@dimatitov
Copy link
Contributor

@dimatitov dimatitov commented Jun 4, 2025

No description provided.

Copy link

vercel bot commented Jun 4, 2025
edited
Loading

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
ru-legacy-reactjs-org ⬜️ Ignored (Inspect) Visit Preview Jun 4, 2025 7:43pm

Copy link
Collaborator

@titovmx titovmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

спасибо за перевод! оставил один комментарий на подумать

</Sandpack>

Without `flushSync`, the print dialog will display `isPrinting` as "no". This is because React batches the updates asynchronously and the print dialog is displayed before the state is updated.
Без `flushSync` диалог печати будет показывать `isPrinting` как "no". Это происходит потому, что React группирует обновления асинхронно, и диалог печати отображается до обновления состояния.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Без `flushSync` диалог печати будет показывать `isPrinting` как "no". Это происходит потому, что React группирует обновления асинхронно, и диалог печати отображается до обновления состояния.
Без `flushSync` диалог печати будет показывать `isPrinting` как "нет". Это происходит потому, что React группирует обновления асинхронно, и диалог печати отображается до обновления состояния.

здесь отсылка к переведённому примеру

* `flushSync` may run pending Effects and synchronously apply any updates they contain before returning.
* `flushSync` may flush updates outside the callback when necessary to flush the updates inside the callback. For example, if there are pending updates from a click, React may flush those before flushing the updates inside the callback.
* `flushSync` может значительно ухудшить производительность. Используйте его с осторожностью.
* `flushSync` может заставить ожидающие границы Suspense показать состояние `fallback`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут можно перевести и Suspense, и fallback (как было выше в переводе сделано)
для обоих терминов у нас есть согласованный перевод в правилах:
Suspense - задержка
fallback - запасной

либо уточнить, что речь идёт про компонент и его проп соответственно

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ещё может быть вместо "границы" использовать "условия"? Как-будто чуть более понятно должно быть.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@titovmx titovmx titovmx left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /