๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ฌ

(50)
useMemo ์™€ useCallback ์€ ๋ฌด์—‡์ด ๋‹ค๋ฅธ ๊ฒƒ์ธ๊ฐ€...... useMemo((...) => fn, deps) === useCallback(fn, deps) useMemo ๋Š” ๋ฉ”๋ชจ์ œ์ด์…˜ ๋œ ๊ฐ’์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค. = ํ•จ์ˆ˜๋ฅผ ์‹คํ–‰ํ•œ๋‹ค. useCallback ์€ ๋ฉ”๋ชจ์ œ์ด์…˜ ๋œ ํ•จ์ˆ˜๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค. => ์•„์˜ˆ ์ƒˆ๋กœ์šด ํ•จ์ˆ˜๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— ๊ฐ๊ฐ ๋‹ค๋ฅธ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๊ฐ€์ง„๋‹ค!!!!!!!!!!!!! ๊ทธ๋ž˜์„œ ์žฅ์ ?
40์ผ์ฐจ ๐Ÿฆ 40์ผ์ฐจ Part 10. React ๋กœ ์‡ผํ•‘๋ชฐ ๋งŒ๋“ค๊ธฐ (React ๊ธฐ๋ณธ) Ch 10. Deploy React App Ch 11. React ๋กœ ๋งŒ๋“œ๋Š” ์‡ผํ•‘๋ชฐ ํ”„๋กœ์ ํŠธ Ch 10. Deploy React App ๐Ÿ”— SPA ํ”„๋กœ์ ํŠธ ๋ฐฐํฌ ์ดํ•ดํ•˜๊ธฐ ๋ชจ๋“  ์š”์ฒญ์„ ์„œ๋ฒ„์— ํ•˜๊ณ  ๋ฐ›์•„์˜ค๋Š” ํ˜•ํƒœ๊ฐ€ ์•„๋‹˜ ๋ผ์šฐํŒ… ๊ฒฝ๋กœ์— ์ƒ๊ด€์—†์ด ๋ฆฌ์•กํŠธ ์•ฑ์„ ๋ฐ›์•„ ์‹คํ–‰ ๋ผ์šฐํŒ…์€ ๋ฐ›์•„์˜จ ๋ฆฌ์•กํŠธ ์•ฑ์„ ์‹คํ–‰ ํ›„, ์ ์šฉ static ํŒŒ์ผ์„ ์ œ์™ธํ•œ ๋ชจ๋“  ์š”์ฒญ์„ index.html ๋กœ ์‘๋‹ตํ•ด ์ฃผ๋„๋ก ์ž‘์—… $ nvm install 10.16.3 $ npm ci $ npm run build ๐Ÿ”— serve ํŒจํ‚ค์ง€๋กœ React Web App ๋ฐฐํฌํ•˜๊ธฐ $ npm install serve -g $ serve -s build # -s ์˜ต์…˜์€ ์–ด๋–ค ๋ผ์šฐํŒ…์œผ๋กœ ..
39์ผ์ฐจ ๐Ÿ™ 39์ผ์ฐจ Part 10. React ๋กœ ์‡ผํ•‘๋ชฐ ๋งŒ๋“ค๊ธฐ (React ๊ธฐ๋ณธ) Ch 8. React Testing Ch 9. React Advanced Ch 8. React Testing ๐Ÿ”— JavaScript Unit Test & Jest ์‚ฌ์šฉํ•˜๊ธฐ https://jestjs.io/docs/expect Expect · Jest When you're writing tests, you often need to check that values meet certain conditions. expect gives you access to a number of "matchers" that let you validate different things. jestjs.io https://github.com/testing-..
38์ผ์ฐจ ๐Ÿ™€ 38์ผ์ฐจ Part 10. React ๋กœ ์‡ผํ•‘๋ชฐ ๋งŒ๋“ค๊ธฐ (React ๊ธฐ๋ณธ) Ch 7. Hooks & Context Ch 6. Hooks & Context ๐Ÿ”— Basic Hooks : ์ปดํฌ๋„ŒํŠธ์˜ state์™€ ๊ด€๋ จ๋œ ๋กœ์ง์„ ์žฌ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. Functional Component != Stateless Componet because state hooks https://ko.reactjs.org/docs/hooks-intro.html useState: state ๋ฅผ ๋Œ€์ฒดํ•  ์ˆ˜ ์žˆ๋‹ค. // ./App.js ... import Example1 from "./components/Example1"; import Example2 from "./components/Example2"; import Example3 fro..
37์ผ์ฐจ ๐Ÿง 37์ผ์ฐจ Part 10. React ๋กœ ์‡ผํ•‘๋ชฐ ๋งŒ๋“ค๊ธฐ (React ๊ธฐ๋ณธ) Ch 6. ๋ฆฌ์•กํŠธ ์‹ค์ „ ํ™œ์šฉ Ch 6. ๋ฆฌ์•กํŠธ ์‹ค์ „ ํ™œ์šฉ ๐Ÿ”— HOC (Higher Order Component) : ๋ฅผ ์ธ์ž๋กœ ๋ฐ›์•„ ๋ฅผ ๋ฆฌํ„ดํ•˜๋Š” ํ•จ์ˆ˜ https://ko.reactjs.org/docs/higher-order-components.html ๊ณ ์ฐจ ์ปดํฌ๋„ŒํŠธ – React A JavaScript library for building user interfaces ko.reactjs.org https://github.com/mridgway/hoist-non-react-statics GitHub - mridgway/hoist-non-react-statics: Copies non-react specific statics from..
36์ผ์ฐจ ๐Ÿผ 36์ผ์ฐจ Part 10. React ๋กœ ์‡ผํ•‘๋ชฐ ๋งŒ๋“ค๊ธฐ (React ๊ธฐ๋ณธ) Ch 5. React Component Styling Ch 5. React Component Styling ๐Ÿ”— Style Loaders // webpack.config.js // import './App.css'; { test: cssRegex, exclude: cssModuleRegex, use: getStyleLoaders({ importLoaders: 1, sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment, modules: { mode: 'icss', }, }), sideEffects: true, }, // import styles from './App...
35์ผ์ฐจ ๐Ÿฆฆ 35์ผ์ฐจ Part 10. React ๋กœ ์‡ผํ•‘๋ชฐ ๋งŒ๋“ค๊ธฐ (React ๊ธฐ๋ณธ) Ch 4. React Router Ch 4. React Router https://reactrouter.com/ Declarative routing for React apps at any scale | React Router Version 6 of React Router is here! React Router v6 takes the best features from v3, v5, and its sister project, Reach Router, in our smallest and most powerful package yet. reactrouter.com $ npm i react-router-dom // App.js impor..
34์ผ์ฐจ ๐ŸฆŠ 34์ผ์ฐจ Part 10. React ๋กœ ์‡ผํ•‘๋ชฐ ๋งŒ๋“ค๊ธฐ (React ๊ธฐ๋ณธ) Ch 3. Creating React Project Ch 3. Creating React Project https://create-react-app.dev/ Create React App Set up a modern web app by running one command. create-react-app.dev $ npx create-react-app my-app // package.json { "scripts": { "start": "react-scripts start", // npm start (๊ฐœ๋ฐœ์šฉ) "build": "react-scripts build", // npm run build (ํ”„๋กœ๋•์…˜์šฉ) "test": "rea..