๐ ์ฐธ๊ณ ๊ฐ์
[๋ฌด๋ฃ] ๋ฐ๋ผํ๋ฉฐ ๋ฐฐ์ฐ๋ ๋ ธ๋, ๋ฆฌ์กํธ ์๋ฆฌ์ฆ - ๊ธฐ๋ณธ ๊ฐ์ - ์ธํ๋ฐ | ๊ฐ์
์ด ๊ฐ์๋ฅผ ํตํด์ ๋ฆฌ์กํธ์ ๋ ธ๋๋ฅผ ์ด๋ป๊ฒ ์ฌ์ฉํ๋์ง ๊ธฐ๋ณธ์ ์ธ ๋ด์ฉ๋ค์ ๋ฐฐ์ธ ์ ์์ต๋๋ค., - ๊ฐ์ ์๊ฐ | ์ธํ๋ฐ...
www.inflearn.com
๐ฃ๋ฐฑ์๋ฒ์ ํ๋ก ํธ ์๋ฒ ๊ฐ์ด ์ผ๋๋ฒ
npm install concurrently --save
index.js ํ์ผ "scripts"์ ์๋ ์ฝ๋ ์ถ๊ฐํ๋ฉด npm run dev ํ๋ฉด ๋ฐฑ์๋ฒ, ํ๋ก ํธ์๋ฒ ๊ฐ์ด ์ผค ์ ์์
"dev": "concurrently \"npm run backend\" \"npm run start --prefix client\""
๐ฃCSS Framework
-CSS Framework ์ฌ์ฉ ์ด์ : ๊ธฐ๋ฅ ๋ง๋๋๋ฐ ์ง์คํ๊ธฐ ์ํด์
-CSS Framework ์ข ๋ฅ for React JS : Material UI, React Bootstrap, Semantic UI, And Design, Materialize...
! ์ด๋ฒ์๋ ant design ์ฌ์ฉํ ๊ฑฐ์ !
#ant design
cd client
npm install antd --save
Ant Design of React - Ant Design
Polyfills are needed for IE browsers. We recommend @babel/preset-env for it. You can set targets config if you are using umi. We recommend using npm or yarn to install, it not only makes development easier, but also allow you to take advantage of the rich
ant.design
๐ฃRedux
state์ ๊ด๋ฆฌํ๋ ํด / Redux is a predictable state container for JavaScript apps. ์ํ ๊ด๋ฆฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
-Props vs State
| Props | State |
| 1. properties ์ค์๋ง 2. Props are how components talk to each other 3. Props flow downwards from the parent compnent 4. Props are immutable from the child perspective if you want to change that value? the parent should jst change its internal state |
1. parent component์์ child component๋ก data๋ฅผ ๋ณด๋ด๋๊ฒ ์๋ ๊ทธ component ์์์ ๋ฐ์ดํฐ๋ฅผ ์ ๋ฌํ๋ ค๋ฉด? State๋ก ์๋ฅผ ๋ค์ด, ๊ฒ์ ์ฐฝ์ ๊ธ์ ์ ๋ ฅํ ๋ ๊ธ์ด ๋ณํ๋ ๊ฒ์ state๋ฅผ ๋ฐ๊ฟ 2. State is mutable 3.State์ด ๋ณํ๋ฉด re-render๋จ |


ํ๋ฐฉํฅ์ผ๋ก๋ง ํ๋ฆ

Action์ ๊ฐ์ฒด ํ์


- Redux ์ค์น๋ฒ
client ํด๋์์ dependency ๋ค์ด๋ฐ๊ธฐ
npm install redux react-redux redux-promise redux-thunk --save
- redux-promise / redux-thunkredux ์ญํ
store ๋ณ๊ฒฝํ๋ ๋ฒ : dispatch action์ผ๋ก ๋ณ๊ฒฝ๊ฐ๋ฅ
store์์ ์ธ์ ๊ฐ ๊ฐ์ฒดํ์์ผ๋ก ๋ action์ ๋ฐ๋ ๊ฒ์ ์๋ / promise, functions ํํ๋ก ๋ฐ์์๋ ์์
> redux store์ ์ค์ง ๊ฐ์ฒด ํ์๋ง ๋ฐ์ ์ ์์ผ๋๊น redux-thunk๋ functions์ ๋ฐ๋ ๋ฒ์ ์๋ ค์ฃผ๊ณ redux-promise๋ promise ๋ฐ๋ ๋ฒ ์๋ ค์ฃผ๋ ์ญํ ์ ํจ
- redux extension ์ถ๊ฐํ๊ธฐ
Redux DevTools
Redux DevTools for debugging application's state changes.
chrome.google.com
๐ฃReact vs React Hooks
-React Component
| Class Component | Functional Component |
| Provide more features ๋ ๋ง์ ๊ธฐ๋ฅ๋ค | Provide less features ์ ๊ณตํ๋ ๊ธฐ๋ฅ์ด ํ์ ์ |
| Longer Code | Shorter Code |
| More Complex Code | Simpler Code |
| Slower Performance ๋๋ฆผ | Faster Performance ์ฑ๋ฅ์ด ๋น๊ต์ ์ข์ |
React Hooks ์๊น > Functional Component with simpler syntax and faster performance ์ฌ์ฉํ ์ ์๊ฒ ๋จ