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.
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
[Beta] docs(cn): translate reference/render.md #632
[Beta] docs(cn): translate reference/render.md #632
Changes from all commits
d5127cc
84c6d8c
ddb3ec1
95cccbb
0443114
372bd2f
e157edd
0403b2d
fc1d8f5
2f09ef6
bf495ad
faff25f
f71ffbf
7822a0a
6db8456
4e836e1
52bd7f9
4f6dd7b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改建议:
container
中的 DOM“There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这句明显错了,应该是"该容器本身不会被修改"、”只有其子节点会被修改“
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
”在完全 使用 React 构建的应用程序中,你需要在你应用程序的最顶层执行一次该操作——渲染 "根" 组件。“
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你好吗?
How are you 不是 who are you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议改成 更新已渲染的树 或 更新已渲染的组件树,因为组件树是 React 中的,DOM 树是浏览器中的,两者不能混淆,而且下文中有对两者关系的叙述,应该区别清楚,避免增加理解难度
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
behavior 除了可以指行为,还可以指特性,这里译为特性更合适
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果你再次调用
render
的话,React 会为了体现最新的 JSX 而进行必要的 DOM 更新。React 会通过将 DOM 与先前渲染的组件树进行 "匹配" 的方式,来决定 DOM 的哪些部分可以重用,哪些需要重新创建。重复调用render
与调用setState
类似——在这两种情况下,React 都会避免不必要的 DOM 更新。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你可以将一个回调函数作为第三个参数传递给
render
。React 会在你的组件在 DOM 中出现后调用它。