-
Notifications
You must be signed in to change notification settings - Fork 88
docs(tw): translate state-and-lifecycle #16
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
docs(tw): translate state-and-lifecycle #16
Conversation
Deploy preview for zh-hant-reactjs ready! Built with commit ad67e2f |
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.
Hey @neighborhood999 I think this is 99% done! You missed a few lines but those can be fixed in 3 minutes. I will merge this in as soon as they're fixed. Thank you!
content/docs/state-and-lifecycle.md
Outdated
|
||
For example, this code may fail to update the counter: | ||
例如,這個程式碼可能無法更新 counter: | ||
|
||
```js | ||
// Wrong |
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.
// 錯誤
content/docs/state-and-lifecycle.md
Outdated
@@ -355,7 +355,7 @@ this.setState({ | |||
}); | |||
``` | |||
|
|||
To fix it, use a second form of `setState()` that accepts a function rather than an object. That function will receive the previous state as the first argument, and the props at the time the update is applied as the second argument: | |||
要修正這個問題,使用第二種形式的 `setState()`,它接受一個 function 而不是一個 object。Function 將接收先前的 state 作為第一個參數,並且將更新的 props 作為第二個參數: | |||
|
|||
```js | |||
// Correct |
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.
Missing line 361
content/docs/state-and-lifecycle.md
Outdated
@@ -364,7 +364,7 @@ this.setState((state, props) => ({ | |||
})); | |||
``` | |||
|
|||
We used an [arrow function](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions) above, but it also works with regular functions: | |||
在上面我們使用 [arrow function](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions),但它也可以適用於正常的 function: | |||
|
|||
```js | |||
// Correct |
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.
Missing line 370
content/docs/state-and-lifecycle.md
Outdated
|
||
For example, this will not re-render a component: | ||
例如,這將不會重新 render component: | ||
|
||
```js | ||
// Wrong |
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.
Missing line 330
content/docs/state-and-lifecycle.md
Outdated
|
||
```js | ||
// Wrong | ||
this.state.comment = 'Hello'; | ||
``` | ||
|
||
Instead, use `setState()`: | ||
相反的,使用 `setState()`: | ||
|
||
```js | ||
// Correct |
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.
Missing line 337
@chloewlin Thank you for reviewing. In the above some terms we should check need translate or not. |
@neighborhood999 no problem. Let me merge this in and we can open another discussion on individual terms. |
This tech terms I keep the original: