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

๐“ก๐“ธ๐“ธ๐“ถ3:๐น๐“‡๐‘œ๐“ƒ๐“‰๐‘’๐“ƒ๐’น/๐“ก๐Ÿฅ๐Ÿข๐Ÿค:๐‘…๐‘’๐’ถ๐’ธ๐“‰

[React] 1. ๋ฆฌ์•กํŠธ๋ž€? + ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์„ค์ •

react : ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ๋งŒ๋“ค๊ธฐ ์œ„ํ•œ Java Script ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ(ํ”„๋ ˆ์ž„์›Œํฌ)

 

- ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ํŽธํ•˜๊ฒŒ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Œ, ์‚ฌ์šฉ์ž ๊ฒฝํ—˜์ด ์ข‹์Œ

Single page application , ํŽ˜์ด์ง€ ๋„˜์–ด๊ฐ€๋Š”๊ฒŒ ์ž์—ฐ์Šค๋Ÿฌ์›€

- ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ํŽธํ•˜๊ฒŒ ํ•˜๋ ค๊ณ  (๋ฐ์ดํ„ฐ์™€ ํ™”๋ฉด ์ผ์น˜์‹œํ‚ค๋Š”๊ฒŒ ์ข‹์•„์ง)

- ์ปดํฌ๋„ŒํŠธ๋“ค(์กฐ๊ฐ๋“ค) ์žฌ์‚ฌ์šฉ ๊ฐ€๋Šฅ

 

์‚ฌ์šฉ์ž ์ •์˜ ํƒœ๊ทธ๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ (= ์ปดํฌ๋„ŒํŠธ)

-> ๊ฐ€๋…์„ฑ ๋†’์ผ ์ˆ˜ ์žˆ์Œ

-> ์žฌ์‚ฌ์šฉ ๊ฐ€๋Šฅ

-> ์œ ์ง€๋ณด์ˆ˜์˜ ํŽธ๋ฆฌ์„ฑ

 

 

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash

bash install_nvm.sh 
source ~/.profile

nvm ls-remote

์ด๋ ‡๊ฒŒ nodejs์™€ npm์„ ๊น”์•˜๊ณ ,

 

 

์ด๋ ‡๊ฒŒ create react app๊นŒ์ง€ ๊น”์•˜๋‹ค!

๋‹ค์Œ์€ react project๋ฅผ ๋งŒ๋“ค ํด๋”๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.

github.com/facebook/create-react-app

 

facebook/create-react-app

Set up a modern web app by running one command. Contribute to facebook/create-react-app development by creating an account on GitHub.

github.com

์ด ๋ฌธ์„œ์— ๋”ฐ๋ฅด๋ฉด ์„ธ ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ด ์žˆ์—ˆ๋Š”๋ฐ ๋‚œ ๊ทธ๋ƒฅ npm์ด ๋Œ๋ ค์„œ ๊ทธ๊ฑธ๋กœ ํ–ˆ๋‹ค ใ…‹ใ…‹

์„ฑ๊ณต์ ์œผ๋กœ ํด๋”๋ฅผ ๋งŒ๋“ค๊ณ  ๋‚˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํด๋”๊ฐ€ ์ƒ์„ฑ๋œ ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

์ž ๊ทธ๋ฆฌ๊ณ  my-app ํด๋”์— ๋“ค์–ด๊ฐ€์„œ npm start๋ฅผ ์ณ์ฃผ๋ฉด!

์š” ์ฐฝ๊ณผ ํ•จ๊ป˜ localhost:3000 ์‚ฌ์ดํŠธ๊ฐ€ ์—ด๋ฆฌ๊ฒŒ ๋œ๋‹น'

๋งŒ์•ฝ react์‹คํ–‰์„ ๋ฉˆ์ถ”๊ณ  ์‹ถ๋‹ค๋ฉด ctrl + c ๋ฅผ ๋ˆ„๋ฅด๋ฉด ์ข…๋ฃŒ๋œ๋‹ค.

 

 

++++++

์‚ฝ์งˆ ๊ธฐ๋ก

 

react์•ฑ ํด๋”๋ฅผ ๊ธฐ์กด ๊นƒ์— ์—ฐ๋™ํ•ด๋†“์€ react_practice ํด๋” ์•ˆ์— ๋„ฃ์–ด commit, push๋ฅผ ์‹œ๋„ํ•ด๋ณด์•˜์ง€๋งŒ

warning: adding embedded git repository ๋ผ๋Š” ์—๋Ÿฌ๊ฐ€ ๊ณ„์† ๋‚˜๊ณ  ์ œ๋Œ€๋กœ push ๊ฐ€ ์•ˆ๋˜๊ณ  ์žˆ์—ˆ๋‹ค!! 

๋Œ€์ถฉ ์ฐพ์•„๋ณด๋‹ˆ react ํด๋” ์•ˆ์— .git ํด๋”๊ฐ€ ์ž๋™์œผ๋กœ ์ƒ์„ฑ๋˜์–ด ๊ทธ ํด๋”์˜ git ๊ณผ ๊ทธ ์ƒ์œ„ ํด๋” git ๊ณผ ์ถฉ๋Œ์ด ๋‚˜๋Š” ๋“ฏ ํ–ˆ๊ณ  ์—ฌ๋Ÿฌ ๋ฒˆ์˜ ์‚ฝ์งˆ ๋์— ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค

 

์ •๋‹ต์€ rm -rf .git์ด์—ˆ๋‹ค... ์ €๊ฑฐ ํ•˜๊ณ  ๋‚˜๋‹ˆ .git ํŒŒ์ผ์ด ์‚ฌ๋ผ์ง. ๊ทผ๋ฐ ๊ทธ๋ƒฅ ํด๋” ์งธ ์ง€์› ์–ด๋„ ๋ ๋“ฏ..

 

 

+++++ ์ €๋ž˜๋„ ์ œ๋Œ€๋กœ ์ธ์‹ ๋ชปํ•˜๊ณ  commit push ์•ˆ๋ผ์„œ ํฌ๊ธฐํ•˜๊ณ  ํด๋” ๋ถ„๋ฆฌํ–ˆ๋‹ค^___^ ๋ง˜ ํŽธ์•ˆ..