web/react

[React] ๋ฆฌ์•กํŠธ ์‹œ์ž‘ํ•˜๊ธฐ

๐ŸŽฏ ๋ฆฌ์•กํŠธ ์„ค์น˜ ๋ฐ ์…‹ํŒ… ๋ช…๋ น์–ด

1. Node.js ๊ฒ€์ƒ‰ ํ›„ ์ตœ์‹ ๋ฒ„์ „์„ ์„ค์น˜ํ•œ๋‹ค.

2. Visual Studio Code ์—๋””ํ„ฐ๋ฅผ ์„ค์น˜ํ•œ๋‹ค.

3. ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•  ํด๋”๋ฅผ ์ƒ์„ฑํ•œ ํ›„, ์—๋””ํ„ฐ์—์„œ ์ž‘์—…ํด๋”๋ฅผ Open Folder ํ•œ๋‹ค.

4. ํ„ฐ๋ฏธ๋„์—์„œ npx create-react-app ํ”„๋กœ์ ํŠธ๋ช…์„ ์ž…๋ ฅํ•ด์„œ ๋ฆฌ์•กํŠธ ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.

5. cd ํ”„๋กœ์ ํŠธ๋ช…(ํด๋”) ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ํ”„๋กœ์ ํŠธ๋ช…์˜ ํ•˜์œ„ํด๋”๋กœ ์ด๋™ํ•œ๋‹ค.

6. ์ฝ”๋“œ ์ž‘์„ฑ ํ›„, ํ„ฐ๋ฏธ๋„์—์„œ npm start๋ฅผ ํ†ตํ•ด ํ”„๋กœ์ ํŠธ๋ฅผ ์‹คํ–‰ํ•œ๋‹ค.

 

๐ŸŽฏ ๋ฆฌ์•กํŠธ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ ํ›„ ์ •๋ฆฌ ๋ฐ ํ™•์ธํ•  ํŒŒ์ผ

1. public ํด๋” > logo.png, manifest.json ์‚ญ์ œ

2. src ํด๋” > App.js์—์„œ ์ปดํฌ๋„ŒํŠธ๋“ค์„ ๋กœ๋“œ ํ›„ ์‚ฌ์šฉ

 

๐ŸŽฏ ๋ฆฌ์•กํŠธ ํ”„๋กœ์ ํŠธ git repository์— ์—…๋กœ๋“œ

1. git repository ์ƒ์„ฑ

2. git init์„ ํ•˜๊ธฐ ์œ„ํ•ด rm -r .git์„ ํ†ตํ•ด ์ด๋ฏธ ์กด์žฌํ•˜๋Š” .git ํŒŒ์ผ์„ ์ง€์›Œ์ค€๋‹ค.

3. git init์„ ํ†ตํ•ด git ํ™˜๊ฒฝ์„ ๋งŒ๋“ค์–ด์ค€๋‹ค.

4. ์ƒ์„ฑํ•œ repository๋ฅผ git remote add origin repository์ฃผ์†Œ๋ฅผ ํ†ตํ•ด remote๋กœ ๋“ฑ๋กํ•œ๋‹ค.

5. git add .๋ฅผ ํ†ตํ•ด create-react-app์œผ๋กœ ๋งŒ๋“ค์–ด์ง„ ํŒŒ์ผ๋“ค์„ stagingํ•œ๋‹ค.

6. git commit -m "first commit"

7. git push origin master

 

 

 

 

 

 

[ ์ฐธ๊ณ  ]

- https://www.youtube.com/watch?v=nahwuaXmgt8

- https://velog.io/@dev_sanghoon/React-create-react-app%EC%9C%BC%EB%A1%9C-%EB%A7%8C%EB%93%A0-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-git-repository%EC%97%90-%EC%97%85%EB%A1%9C%EB%93%9C%ED%95%98%EA%B8%B0

 

'web > react' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[React] props  (0) 2021.09.15
[React] useEffect  (0) 2021.09.15
[React] ์ปดํฌ๋„ŒํŠธ์™€ state  (0) 2021.09.13