Translate activity clean#1917
Open
OpenLucasKaka wants to merge 11 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Size changesDetails📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
loveloki
reviewed
May 11, 2026
Collaborator
loveloki
left a comment
There was a problem hiding this comment.
如果同意建议的话直接应用就行,有不同意见在里面进行评论,记得不要 force push,提交新的 commit 来进行修改
Co-authored-by: Xleine <github@xleine.moe>
Co-authored-by: Xleine <github@xleine.moe>
Co-authored-by: Xleine <github@xleine.moe>
Co-authored-by: Xleine <github@xleine.moe>
Co-authored-by: Xleine <github@xleine.moe>
Co-authored-by: Xleine <github@xleine.moe>
Author
|
已全部修复 |
loveloki
reviewed
May 12, 2026
| ### 恢复隐藏组件的 DOM {/*restoring-the-dom-of-hidden-components*/} | ||
|
|
||
| Since Activity boundaries hide their children using `display: none`, their children's DOM is also preserved when hidden. This makes them great for maintaining ephemeral state in parts of the UI that the user is likely to interact with again. | ||
| 由于 `Activity` 边界使用 `display: none` 来隐藏其子组件,因此这些子组件的 DOM 在隐藏时也会被保留。这使得它们非常适合用于维护 UI 中那些用户可能会再次交互的部分的 ephemeral state。 |
Collaborator
There was a problem hiding this comment.
可能是我没有表达清楚,这里 ephemeral state 可以翻译成中文,但是第一次翻译需要带上原文。例如:瞬时状态(ephemeral state),之前的问题是在第二次中文翻译的地方添加的英文原文。
不是说要恢复成英文,把这个再调整一下吧
| ``` | ||
|
|
||
| When an Activity boundary is <CodeStep step={1}>hidden</CodeStep> during its initial render, its children won't be visible on the page — but they will _still be rendered_, albeit at a lower priority than the visible content, and without mounting their Effects. | ||
| 当 `Activity` 边界在初次渲染时处于 <CodeStep step={1}>隐藏</CodeStep> 状态,其子组件虽然不会在页面上显示,但它们**仍会被渲染**。不过,它们的渲染优先级会低于可见内容,且不会挂载它们的 Effect。 |
Collaborator
There was a problem hiding this comment.
Suggested change
| 当 `Activity` 边界在初次渲染时处于 <CodeStep step={1}>隐藏</CodeStep> 状态,其子组件虽然不会在页面上显示,但它们**仍会被渲染**。不过,它们的渲染优先级会低于可见内容,且不会挂载它们的 Effect。 | |
| 当 `Activity` 边界在初次渲染时处于 <CodeStep step={1}>隐藏</CodeStep> 状态,其子组件虽然不会在页面上显示,但它们 **仍会被渲染**。不过,它们的渲染优先级会低于可见内容,且不会挂载它们的 Effect。 |
| `Activity` 边界通过在其子组件上设置 `display: none` 并清理它们所有的 Effect 来隐藏内容。因此,大多数遵循最佳实践、能够正确清理自身副作用的 React 组件,在被 `Activity` 隐藏时都具有足够的健壮性。 | ||
|
|
||
| But there _are_ some situations where a hidden component behaves differently than an unmounted one. Most notably, since a hidden component's DOM is not destroyed, any side effects from that DOM will persist, even after the component is hidden. | ||
| 但是,也**确实存在**一些情况下,隐藏组件的表现与卸载组件确实有所不同。最显著的一点是:由于隐藏组件的 DOM 并没有被销毁,来自该 DOM 的任何副作用都将持续存在,即便在组件被隐藏之后也是如此。 |
Collaborator
There was a problem hiding this comment.
Suggested change
| 但是,也**确实存在**一些情况下,隐藏组件的表现与卸载组件确实有所不同。最显著的一点是:由于隐藏组件的 DOM 并没有被销毁,来自该 DOM 的任何副作用都将持续存在,即便在组件被隐藏之后也是如此。 | |
| 但是,也 **确实存在** 一些情况下,隐藏组件的表现与卸载组件确实有所不同。最显著的一点是:由于隐藏组件的 DOM 并没有被销毁,来自该 DOM 的任何副作用都将持续存在,即便在组件被隐藏之后也是如此。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
已经重新从main拉去最新代码 并将review后的更改合并