Skip to content

docs(cn): translate content/docs/lifting-state-up.md into Chinese#90

Merged
QC-L merged 10 commits into
reactjs:masterfrom
baxtergu:cn_gsn
Mar 5, 2019
Merged

docs(cn): translate content/docs/lifting-state-up.md into Chinese#90
QC-L merged 10 commits into
reactjs:masterfrom
baxtergu:cn_gsn

Conversation

@baxtergu
Copy link
Copy Markdown
Collaborator

Review of this PR is welcomed.

@QC-L QC-L added the Pending Review 已翻译,待校对阶段 label Feb 12, 2019
Comment thread content/docs/lifting-state-up.md
Comment thread content/docs/lifting-state-up.md
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Co-Authored-By: baxtergu <baxtergu@gmail.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 13, 2019

Deploy preview for cn-reactjs ready!

Built with commit 52141f1

https://deploy-preview-90--cn-reactjs.netlify.com

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 13, 2019

Deploy preview for cn-reactjs ready!

Built with commit a561826

https://deploy-preview-90--cn-reactjs.netlify.com

@QC-L QC-L mentioned this pull request Feb 14, 2019
Copy link
Copy Markdown
Contributor

@hijiangtao hijiangtao left a comment

Choose a reason for hiding this comment

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

Some suggestions on this pull request, thanks for your translation.

Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
@QC-L QC-L added Pending Modify 已校对,待修改阶段 and removed Pending Review 已翻译,待校对阶段 labels Feb 21, 2019
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 22, 2019

Deploy preview for zh-hans-reactjs ready!

Built with commit a561826

https://deploy-preview-90--zh-hans-reactjs.netlify.com

@QC-L QC-L added Pending Re-Review 已修改,待审校阶段 and removed Pending Modify 已校对,待修改阶段 labels Feb 22, 2019
hijiangtao
hijiangtao previously approved these changes Feb 24, 2019
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
我们知道 [props 是只读的](/docs/components-and-props.html#props-are-read-only)。当 `temperature` 存在于 `TemperatureInput` 组件的 state 中时,组件只能通过调用 `this.setState()` 去修改它。然而现在,`temperature` 是由父组件传入的 prop`TemperatureInput` 组件便失去了对它的控制权。

In React, this is usually solved by making a component "controlled". Just like the DOM `<input>` accepts both a `value` and an `onChange` prop, so can the custom `TemperatureInput` accept both `temperature` and `onTemperatureChange` props from its parent `Calculator`.
React 中,这个问题通常是通过让组件“受控”来解决的。与 DOM 中的 `<input>` 接受 `value` `onChange` 一样,自定义的 `TemperatureInput` 组件接受 `temperature` `onTemperatureChange` 这两个来自父组件 `Calculator` 的 props。
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@hijiangtao 这里我觉得 受控组件 更好一些

Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
Comment thread content/docs/lifting-state-up.md Outdated
QC-L
QC-L previously approved these changes Mar 5, 2019
Copy link
Copy Markdown
Contributor

@hijiangtao hijiangtao left a comment

Choose a reason for hiding this comment

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

LGTM

@QC-L QC-L merged commit c567e6c into reactjs:master Mar 5, 2019
OhIAmFine pushed a commit to OhIAmFine/zh-hans.reactjs.org that referenced this pull request May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Pending Re-Review 已修改,待审校阶段

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants