-
Notifications
You must be signed in to change notification settings - Fork 88
docs: translate hooks-custom #72
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
Conversation
Deploy preview for zh-hant-reactjs-org ready! Built with commit 1d254a8 |
c784674
to
e53550e
Compare
e53550e
to
5b8f9dc
Compare
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.
Looks good! Only a few typos.
content/docs/hooks-custom.md
Outdated
|
||
When we want to share logic between two JavaScript functions, we extract it to a third function. Both components and Hooks are functions, so this works for them too! | ||
當我們想要共享邏輯在兩個 JavaScript function 之間時,我們提取它成為第三個 function。Componet 和 Hook 兩者都是 function,所以這也適用於它們! |
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.
當我們想要共享邏輯在兩個 JavaScript function 之間時,我們提取它成為第三個 function。Componet 和 Hook 兩者都是 function,所以這也適用於它們! | |
當我們想要共享邏輯在兩個 JavaScript function 之間時,我們提取它成為第三個 function。Component 和 Hook 兩者都是 function,所以這也適用於它們! |
content/docs/hooks-custom.md
Outdated
|
||
Try to resist adding abstraction too early. Now that function components can do more, it's likely that the average function component in your codebase will become longer. This is normal -- don't feel like you *have to* immediately split it into Hooks. But we also encourage you to start spotting cases where a custom Hook could hide complex logic behind a simple interface, or help untangle a messy component. | ||
盡量不要過早地加入抽象。現在 function component 可以做更多的事,在你 codebase 中的 function componnet 程式碼平均可能都會變得更長。這都是正常的 -- 不要覺得你*必須*馬上把它拆分成 Hook。但我們也鼓勵你開始發現自定義的 Hook 可以隱藏簡單 interface 背後的複雜邏輯情況,或者幫忙解開一個混亂的 component。 |
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.
盡量不要過早地加入抽象。現在 function component 可以做更多的事,在你 codebase 中的 function componnet 程式碼平均可能都會變得更長。這都是正常的 -- 不要覺得你*必須*馬上把它拆分成 Hook。但我們也鼓勵你開始發現自定義的 Hook 可以隱藏簡單 interface 背後的複雜邏輯情況,或者幫忙解開一個混亂的 component。 | |
盡量不要過早地加入抽象。現在 function component 可以做更多的事,在你 codebase 中的 function component 程式碼平均可能都會變得更長。這都是正常的 -- 不要覺得你*必須*馬上把它拆分成 Hook。但我們也鼓勵你開始發現自定義的 Hook 可以隱藏簡單 interface 背後的複雜邏輯情況,或者幫忙解開一個混亂的 component。 |
No description provided.