ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

์ด ๊ธ€์€ ์ƒํ™œ์ฝ”๋”ฉ React ๊ฐ•์˜[opentutorials.org/module/4058]๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ์ž‘์„ฑํ•˜์˜€์Šต๋‹ˆ๋‹ค.

 

https://ko.reactjs.org/docs/getting-started.html

 

[Component]

Top.html

Sidebar.html

๊ณผ ๊ฐ™์€ html ํŒŒ์ผ์„ ๋งŒ๋“ค๊ณ ,

index.html์—์„œ

<Top></Top>

<Sidebar></Sidebar>

๊ณผ ๊ฐ™์ด ํƒœ๊ทธ์ฒ˜๋Ÿผ ์‚ฌ์šฉํ•  ๋•Œ,

์‚ฌ์šฉ์ž ์ •์˜ ํƒœ๊ทธ๋ผ๊ณ  ํ•˜์ง€ ์•Š๊ณ  Component ๋ผ๊ณ  ํ•œ๋‹ค.

์žฅ์ 

1. ๊ฐ€๋…์„ฑ

2. ์žฌ์‚ฌ์šฉ์„ฑ

3. ์œ ์ง€๋ณด์ˆ˜

 

 

[React ๊ณต์‹๋ฌธ์„œ]

https://ko.reactjs.org/docs/getting-started.html

 

์‹œ์ž‘ํ•˜๊ธฐ – React

A JavaScript library for building user interfaces

ko.reactjs.org

 

 

[์ฃผ์˜] cmd์—์„œ ๋“œ๋ผ์ด๋ธŒ ์ด๋™์ด ์•ˆ๋  ๋•Œ

์œˆ๋„์šฐ๋ผ๋ฉด cmd์—์„œ ๋“œ๋ผ์ด๋ธŒ๋ฅผ ์ด๋™ํ•  ๋•Œ

cd D:  //(X)

D:  //(O)

-> cd ์ œ์™ธํ•˜๊ณ  ๊ทธ๋ƒฅ D:๋งŒ ์จ์ค€๋‹ค!!!!!!!!!!!!!!

 

 

[npm์„ ์ด์šฉํ•˜์—ฌ create-react-app ์„ค์น˜]

npx create-react-app my-app
cd my-app
npm start

npx๋Š” create-react-app์„ ์„ค์น˜ํ•˜๊ณ  ์ผํšŒ์ ์œผ๋กœ ์‚ฌ์šฉํ•˜๊ณ  ๋ฐ”๋กœ ์‚ญ์ œ๊นŒ์ง€ ํ•ด์คŒ.

์žฅ์ ์€ ๊ฐ€์žฅ ์ตœ์‹ ์˜ react-app์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ.

๋‚˜๋Š” ์‹ค์Šต ์œ„์ฃผ๋กœ ์ง„ํ–‰ํ•˜๋ ค๊ณ  npx๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์Œ.

์‹ค๋ฌด์—์„œ๋Š” npx ์‚ฌ์šฉ ๊ถŒ์žฅ!

 

 

[์ƒ˜ํ”Œ ์›น์•ฑ ์‹คํ–‰]

๋‚˜๋Š” vs code๋ฅผ ์ด์šฉํ–ˆ๋‹ค.

ํ„ฐ๋ฏธ๋„์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž‘์„ฑํ•œ๋‹ค.

npm run start

๊ทธ๋Ÿฌ๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ƒ˜ํ”Œ ์›น์•ฑ์ด ์‹คํ–‰๋œ๋‹ค.

 

์‹คํ–‰๋œ ์›น์•ฑ ์บก์ณ

ํ„ฐ๋ฏธ๋„์— ctrl + C ๋ฅผ ์ž…๋ ฅํ•˜๋ฉด run์ด ์ค‘์ง€๋œ๋‹ค.

 

 

 

 

 

(์ด๋ฒˆ ํฌ์ŠคํŒ…์€ ์ „์ฒด์ ์ธ ๋‚ด์šฉ์„ ์ •๋ฆฌํ•˜๊ธฐ๋ณด๋‹ค๋Š” ๋‚ด๊ฐ€ ๋ชจ๋ฅด๋Š” ๊ฒƒ๊ณผ ๊ธฐ๋กํ•˜๊ณ  ์‹ถ์€ ๊ฒƒ ์œ„์ฃผ๋กœ ์ •๋ฆฌํ–ˆ๋‹ค.)

๋Œ“๊ธ€