├── es6 ├── sideEffect.js ├── App.js ├── namedExport.js ├── asyncAwait.html ├── esModule.html ├── arrowFunction.html ├── asyncAwaitAdv.html ├── promise.html ├── destructuringAssignment.html ├── forEach.html ├── objectReference.html └── shorthand.html ├── data └── menu.json ├── components ├── weatherIcon │ ├── 多雲時陰.svg │ ├── 多雲短暫雨.svg │ ├── 陰短暫雨.svg │ ├── 陰有雨.svg │ ├── 多雲時陰短暫雨.svg │ ├── 陰時多雲短暫雨.svg │ ├── 多雲時陰有雨.svg │ ├── 陰時多雲有雨.svg │ ├── 多雲.svg │ ├── 晴時多雲.svg │ ├── 多雲時晴.svg │ └── 晴午後短暫雷陣雨.svg ├── dataMap.html ├── propsDestructuring.html ├── createLayout.html ├── nestComponent.html └── createComponent.html ├── index.html ├── intro ├── createApp.html ├── variables.html ├── howToWork.html ├── commonProblem.html ├── jsType.html ├── reactAttr.html └── expression.html ├── form ├── reactForm.html ├── reactForm2.html ├── basicHookForm.html ├── submitForm.html └── formEvent.html ├── hooks ├── inputComponent.html ├── startHooks.html ├── inputUseState.html ├── aboutUseState.html └── useStateCallback.html └── hooksAdv ├── crossComponent.html ├── useCustomHook3.html ├── useCustomHook.html ├── lifeCycle.html ├── useReducerIntro.html └── useMemo.html /es6/sideEffect.js: -------------------------------------------------------------------------------- 1 | (function (global) { 2 | global.$ = '我是 jQuery'; 3 | })(window); -------------------------------------------------------------------------------- /es6/App.js: -------------------------------------------------------------------------------- 1 | 2 | const App = () => { 3 | const myName = '卡斯伯' 4 | return React.createElement('div', null, `我的名字是 ${myName}`); 5 | } 6 | 7 | export default App; -------------------------------------------------------------------------------- /es6/namedExport.js: -------------------------------------------------------------------------------- 1 | export const a = 1; 2 | 3 | export function b() { 4 | console.log('1'); 5 | } 6 | 7 | export function c(a, b) { 8 | return a + b; 9 | } -------------------------------------------------------------------------------- /data/menu.json: -------------------------------------------------------------------------------- 1 | { 2 | "intro": [ 3 | { 4 | "name": "建立 React", 5 | "url": "createApp" 6 | }, 7 | { 8 | "name": "章節挑戰", 9 | "url": "createReactFinal" 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /components/weatherIcon/多雲時陰.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/weatherIcon/多雲短暫雨.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/weatherIcon/陰短暫雨.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/weatherIcon/陰有雨.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/weatherIcon/多雲時陰短暫雨.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/weatherIcon/陰時多雲短暫雨.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/weatherIcon/多雲時陰有雨.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/weatherIcon/陰時多雲有雨.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/weatherIcon/多雲.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/weatherIcon/晴時多雲.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/weatherIcon/多雲時晴.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/weatherIcon/晴午後短暫雷陣雨.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 首頁 2 | 3 |
4 |

首頁

檔名:index.html 5 |

React 練習手冊,請同學搭配課程完成本練習,
練習開始

6 |
7 | 8 | 9 | 10 |
11 | 12 |
13 |
14 | 15 | 42 | 43 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /intro/createApp.html: -------------------------------------------------------------------------------- 1 | 環境安裝 2 | 3 |
4 |

環境安裝

檔名:createApp.html
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 90 | 91 |
92 |
93 | 94 | 121 | 122 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /intro/variables.html: -------------------------------------------------------------------------------- 1 | 使用資料驅動 2 | 3 |
4 |

使用資料驅動

檔名:variables.html
5 | 6 |
7 | 8 | 14 | 15 | 16 |
17 | 18 | 93 | 94 |
95 |
96 | 97 | 124 | 125 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /es6/asyncAwait.html: -------------------------------------------------------------------------------- 1 | Async / Await 2 | 3 |
4 |

Async / Await

檔名:asyncAwait.html
5 | 6 | 7 | 8 | 25 | 26 |
27 | 28 | 103 | 104 |
105 |
106 | 107 | 134 | 135 | 140 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /intro/howToWork.html: -------------------------------------------------------------------------------- 1 | JSX 做了什麼事? 2 | 3 |
4 |

JSX 做了什麼事?

檔名:howToWork.html
5 | 6 |
7 | 16 | 17 | 18 |
19 | 20 | 95 | 96 |
97 |
98 | 99 | 126 | 127 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /es6/esModule.html: -------------------------------------------------------------------------------- 1 | ES 模組 2 | 3 |
4 |

ES 模組

檔名:esModule.html
5 | 6 |
7 | 35 | 36 |
37 | 38 | 113 | 114 |
115 |
116 | 117 | 144 | 145 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /es6/arrowFunction.html: -------------------------------------------------------------------------------- 1 | 箭頭函式 2 | 3 |
4 |

箭頭函式

檔名:arrowFunction.html
5 | 6 |
7 | 49 | 50 |
51 | 52 | 127 | 128 |
129 |
130 | 131 | 158 | 159 | 164 | 165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /es6/asyncAwaitAdv.html: -------------------------------------------------------------------------------- 1 | Async / Await 進階 2 | 3 |
4 |

Async / Await 進階

檔名:asyncAwaitAdv.html
5 | 6 |
7 | 8 | 9 | 47 | 48 |
49 | 50 | 125 | 126 |
127 |
128 | 129 | 156 | 157 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /es6/promise.html: -------------------------------------------------------------------------------- 1 | Promise 2 | 3 |
4 |

Promise

檔名:promise.html
5 | 6 | 7 | 8 | 56 | 57 |
58 | 59 | 134 | 135 |
136 |
137 | 138 | 165 | 166 | 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /components/dataMap.html: -------------------------------------------------------------------------------- 1 | 使用資料驅動元件 2 | 3 |
4 |

使用資料驅動元件

檔名:dataMap.html
5 | 6 |
7 | 36 | 37 |
38 | 39 | 107 | 108 |
109 |
110 | 111 | 138 | 139 | 144 | 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /form/reactForm.html: -------------------------------------------------------------------------------- 1 | React 與表單元素 2 | 3 |
4 |

React 與表單元素

檔名:reactForm.html
5 | 6 |
7 | 31 | 32 |
33 | 34 | 130 | 131 |
132 |
133 | 134 | 161 | 162 | 167 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /es6/destructuringAssignment.html: -------------------------------------------------------------------------------- 1 | 解構 2 | 3 |
4 |

解構

檔名:destructuringAssignment.html
5 | 6 |
7 | 73 | 74 |
75 | 76 | 151 | 152 |
153 |
154 | 155 | 182 | 183 | 188 | 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /hooks/inputComponent.html: -------------------------------------------------------------------------------- 1 | input 元件化 2 | 3 |
4 |

input 元件化

檔名:inputComponent.html
5 | 6 | 7 |
8 | 19 | 20 |
21 | 22 | 132 | 133 |
134 |
135 | 136 | 163 | 164 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /hooks/startHooks.html: -------------------------------------------------------------------------------- 1 | 開始使用 Hooks 2 | 3 |
4 |

開始使用 Hooks

檔名:startHooks.html
5 | 6 |
7 | 20 | 21 |
22 | 23 | 133 | 134 |
135 |
136 | 137 | 164 | 165 | 170 | 171 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /hooks/inputUseState.html: -------------------------------------------------------------------------------- 1 | input 綁定 useState 2 | 3 |
4 |

input 綁定 useState

檔名:inputUseState.html
5 | 6 |
7 | 19 | 20 |
21 | 22 | 132 | 133 |
134 |
135 | 136 | 163 | 164 | 169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /es6/forEach.html: -------------------------------------------------------------------------------- 1 | 陣列方法 2 | 3 |
4 |

陣列方法

檔名:forEach.html
5 | 6 |
7 | 83 | 84 |
85 | 86 | 161 | 162 |
163 |
164 | 165 | 192 | 193 | 198 | 199 | 200 | 201 | 202 | -------------------------------------------------------------------------------- /intro/commonProblem.html: -------------------------------------------------------------------------------- 1 | JSX 常見問題 2 | 3 |
4 |

JSX 常見問題

檔名:commonProblem.html
5 | 6 |
7 | 8 | 33 | 34 | 35 | 44 | 45 |
46 | 47 | 122 | 123 |
124 |
125 | 126 | 153 | 154 | 159 | 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /components/propsDestructuring.html: -------------------------------------------------------------------------------- 1 | 資料解構 2 | 3 |
4 |

資料解構

檔名:propsDestructuring.html
5 | 6 |
7 | 42 | 43 |
44 | 45 | 113 | 114 |
115 |
116 | 117 | 144 | 145 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /intro/jsType.html: -------------------------------------------------------------------------------- 1 | 部分型別注意事項 2 | 3 |
4 |

部分型別注意事項

檔名:jsType.html
5 | 6 |
7 | 42 | 43 | 44 |
45 | 46 | 121 | 122 |
123 |
124 | 125 | 152 | 153 | 158 | 159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /hooksAdv/crossComponent.html: -------------------------------------------------------------------------------- 1 | 跨元件的狀態問題 2 | 3 |
4 |

跨元件的狀態問題

檔名:crossComponent.html
5 | 6 |
7 | 20 | 21 |
22 | 23 | 140 | 141 |
142 |
143 | 144 | 171 | 172 | 177 | 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /form/reactForm2.html: -------------------------------------------------------------------------------- 1 | React 與表單元素 2 2 | 3 |
4 |

React 與表單元素 2

檔名:reactForm2.html
5 | 6 |
7 | 38 | 39 |
40 | 41 | 137 | 138 |
139 |
140 | 141 | 168 | 169 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /hooks/aboutUseState.html: -------------------------------------------------------------------------------- 1 | 關於 useState 2 | 3 |
4 |

關於 useState

檔名:aboutUseState.html
5 | 6 |
7 | 30 | 31 |
32 | 33 | 143 | 144 |
145 |
146 | 147 | 174 | 175 | 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /intro/reactAttr.html: -------------------------------------------------------------------------------- 1 | JSX 與 HTML 的標籤屬性 2 | 3 |
4 |

JSX 與 HTML 的標籤屬性

檔名:reactAttr.html
5 | 6 | 7 |
8 | 9 | 39 | 40 |
41 | 42 |
43 |
44 |
45 |
46 |
47 | 48 | 49 |
50 |
51 | 56 |
57 |
58 | 61 |
62 |
這裡有一段文字
63 |
64 |
65 | 66 |
67 | 68 | 143 | 144 |
145 |
146 | 147 | 174 | 175 | 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /hooks/useStateCallback.html: -------------------------------------------------------------------------------- 1 | useState 的前一個狀態 2 | 3 |
4 |

useState 的前一個狀態

檔名:useStateCallback.html
5 | 6 |
7 | 29 | 30 |
31 | 32 | 142 | 143 |
144 |
145 | 146 | 173 | 174 | 179 | 180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /intro/expression.html: -------------------------------------------------------------------------------- 1 | 什麼是 JavaScript 表達式 2 | 3 |
4 |

什麼是 JavaScript 表達式

檔名:expression.html
5 | 6 |
7 | 8 | 9 | 12 | 15 | 16 | 17 | 39 | 40 | 41 |
42 | 43 | 118 | 119 |
120 |
121 | 122 | 149 | 150 | 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /form/basicHookForm.html: -------------------------------------------------------------------------------- 1 | React Hook Form 基礎 2 | 3 |
4 |

React Hook Form 基礎

檔名:basicHookForm.html
5 | 6 | 7 |
8 | 37 | 38 | 39 |
40 | 41 | 137 | 138 |
139 |
140 | 141 | 168 | 169 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /components/createLayout.html: -------------------------------------------------------------------------------- 1 | 版型建立 2 | 3 |
4 |

版型建立

檔名:createLayout.html
5 | 6 | 7 |
8 | 19 | 20 |
21 |
22 |

月月送菜到你家

23 |

24 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore molestiae 25 | facere asperiores sit aspernatur laboriosam ipsum, excepturi fuga, 26 | consequuntur cupiditate, nam a doloremque error adipisci nulla reiciendis 27 | itaque odio voluptatibus. 28 |

29 |
30 |

基本版

31 |
32 |

$1000/月

33 |

基本每週配給,包含高麗菜、空心菜,健康不馬乎

34 | 35 |
36 |
37 |
38 |

進階版

39 |
40 |

$6000

41 |

奶蛋魚肉經營養師精確估計,適合三人小家庭使用,每週一、四配送

42 | 43 |
44 |
45 |
46 |

企業版

47 |
48 |

請洽客服

49 |

多少人數均可訂製,5 ~ 1000 人團體均適用

50 | 53 |
54 |
55 |
56 | 57 | 58 |
59 | 60 | 128 | 129 |
130 |
131 | 132 | 159 | 160 | 165 | 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /es6/objectReference.html: -------------------------------------------------------------------------------- 1 | 物件參考特性 2 | 3 |
4 |

物件參考特性

檔名:objectReference.html
5 | 6 |
7 | 68 | 69 |
70 | 71 | 146 | 147 |
148 |
149 | 150 | 177 | 178 | 183 | 184 | 185 | 186 | 187 | -------------------------------------------------------------------------------- /form/submitForm.html: -------------------------------------------------------------------------------- 1 | 表單送出 2 | 3 |
4 |

表單送出

檔名:submitForm.html
5 | 6 |
7 | 36 | 37 |
38 | 39 | 135 | 136 |
137 |
138 | 139 | 166 | 167 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /hooksAdv/useCustomHook3.html: -------------------------------------------------------------------------------- 1 | 使用現成的 Hooks 2 | 3 |
4 |

使用現成的 Hooks

檔名:useCustomHook3.html
5 | 6 |
7 | 26 | 27 | 28 |
29 | 30 | 147 | 148 |
149 |
150 | 151 | 178 | 179 | 184 | 185 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /form/formEvent.html: -------------------------------------------------------------------------------- 1 | 表單方法 2 | 3 |
4 |

表單方法

檔名:formEvent.html
5 | 6 |
7 | 41 | 42 |
43 | 44 | 140 | 141 |
142 |
143 | 144 | 171 | 172 | 177 | 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /hooksAdv/useCustomHook.html: -------------------------------------------------------------------------------- 1 | 自定義 Hook 2 | 3 |
4 |

自定義 Hook

檔名:useCustomHook.html
5 | 6 |
7 | 24 | 25 | 31 | 32 |
33 | 34 | 151 | 152 |
153 |
154 | 155 | 182 | 183 | 188 | 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /hooksAdv/lifeCycle.html: -------------------------------------------------------------------------------- 1 | hook 的生命週期概念 2 | 3 |
4 |

hook 的生命週期概念

檔名:lifeCycle.html
5 | 6 |
7 | 24 | 25 |
26 | 27 | 144 | 145 |
146 |
147 | 148 | 175 | 176 | 181 | 182 | 183 | 184 | 185 | -------------------------------------------------------------------------------- /components/nestComponent.html: -------------------------------------------------------------------------------- 1 | 巢狀元件 2 | 3 |
4 |

巢狀元件

檔名:nestComponent.html
5 | 6 |
7 | 63 | 64 |
65 | 66 | 134 | 135 |
136 |
137 | 138 | 165 | 166 | 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /components/createComponent.html: -------------------------------------------------------------------------------- 1 | 建立元件 2 | 3 |
4 |

建立元件

檔名:createComponent.html
5 | 6 |
7 | 56 | 57 |
58 | 59 | 127 | 128 |
129 |
130 | 131 | 158 | 159 | 164 | 165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /es6/shorthand.html: -------------------------------------------------------------------------------- 1 | ES6 縮寫 2 | 3 |
4 |

ES6 縮寫

檔名:shorthand.html 5 |
本課程的程式碼會盡可能利用 ES6 或其縮寫的形式撰寫,本章節會介紹實戰中的常見縮寫語法
6 |
7 | 8 |
    9 |
  • 1
  • 10 |
  • 2
  • 11 |
  • 3
12 | 90 | 91 |
92 | 93 | 168 | 169 |
170 |
171 | 172 | 199 | 200 | 205 | 206 | 207 | 208 | 209 | -------------------------------------------------------------------------------- /hooksAdv/useReducerIntro.html: -------------------------------------------------------------------------------- 1 | useReducerIntro 2 | 3 |
4 |

useReducerIntro

檔名:useReducerIntro.html
5 | 6 | 7 |
8 | 31 | 32 | 33 |
34 | 35 | 152 | 153 |
154 |
155 | 156 | 183 | 184 | 189 | 190 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /hooksAdv/useMemo.html: -------------------------------------------------------------------------------- 1 | useMemo 2 | 3 |
4 |

useMemo

檔名:useMemo.html
5 | 6 |
7 | 34 | 35 |
36 | 37 | 154 | 155 |
156 |
157 | 158 | 185 | 186 | 191 | 192 | 193 | 194 | 195 | --------------------------------------------------------------------------------