You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/learn/index.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,29 +1,29 @@
1
1
---
2
-
title: Quick Start
2
+
title: 快速開始
3
3
---
4
4
5
5
<Intro>
6
6
7
-
Welcome to the React documentation! This page will give you an introduction to the 80% of React concepts that you will use on a daily basis.
7
+
歡迎來到 React 文件!本頁將為你介紹日常使用的 80% React 概念。
8
8
9
9
</Intro>
10
10
11
11
<YouWillLearn>
12
12
13
-
-How to create and nest components
14
-
-How to add markup and styles
15
-
-How to display data
16
-
-How to render conditions and lists
17
-
-How to respond to events and update the screen
18
-
-How to share data between components
13
+
-如何建立和巢狀 component
14
+
-如何加入 markup 和樣式
15
+
-如何顯示資料
16
+
-如何 render 條件和列表
17
+
-如何回應事件和更新畫面
18
+
-如何在 component 之間共享資料
19
19
20
20
</YouWillLearn>
21
21
22
-
## Creating and nesting components {/*components*/}
22
+
## 建立和巢狀 component {/*components*/}
23
23
24
-
React apps are made out of *components*. A component is a piece of the UI (user interface) that has its own logic and appearance. A component can be as small as a button, or as large as an entire page.
React components are JavaScript functions that return markup:
26
+
React component 是回傳 markup 的 JavaScript 函式。
27
27
28
28
```js
29
29
functionMyButton() {
@@ -33,7 +33,7 @@ function MyButton() {
33
33
}
34
34
```
35
35
36
-
Now that you've declared `MyButton`, you can nest it into another component:
36
+
現在你已經宣告 `MyButton`,你可以將它嵌入另一個 component 中。
37
37
38
38
```js {5}
39
39
export default function MyApp() {
@@ -46,9 +46,9 @@ export default function MyApp() {
46
46
}
47
47
```
48
48
49
-
Notice that `<MyButton />`starts with a capital letter. That's how you know it's a React component. React component names must always start with a capital letter, whileHTMLtags must be lowercase.
@@ -73,7 +73,7 @@ export default function MyApp() {
73
73
74
74
</Sandpack>
75
75
76
-
The `export default`keywords specify the main componentin the file. If you're not familiar with some piece of JavaScript syntax, [MDN](https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export) and [javascript.info](https://javascript.info/import-export) have great references.
0 commit comments