CODING/React.js

노마드코더강의_React#1

피그말리온(PYGM) 2020. 6. 12. 22:27

node.js, npm 설치

npx 설치: cmd > npm install npx -g

git 설치(git-scm.com)

 

 

기본 폴더: cd C:\USER\arthu\documents

 

npx create-react-app 앱 이름  --> 바벨 등 설치 할 필요 없음

 

node.js 설치

npm, npx 설치

cmd > 'npx create-react-app 앱이름' 생성

그 폴더로 들어가서 npm start

yarn.lock파일 삭제

 

 

#readme파일

간단하게 설명넣기

 

#package.json파일

script부분이 중요

   "start": "react-scripts start",

    "build": "react-scripts build",

    "test": "react-scripts test",

    "eject": "react-scripts eject"  //test와 eject는 삭제해도 되는 듯

 

cmd > npm start

git 초기화 > git init

github 홈페이지 이동 > Create a new repository > 만듦

나오는 github.com/Sehwanjun/movie_app_2020.git 이것처럼 주소 복사해서

cmd > git remote add origin github.com/Sehwanjun/movie_app_2020.git

 

바뀐 내용 git에 넣기>

git commit -m "#1.0 Creating your first React App"

git push origin master

 

github사이트 리프레쉬 하면 파일 들어가 있는것 확인

 

 

생성되는 폴더 설명>

public ==> 화면 맨 위에서 볼 수 있는 상단에 나오는 것 관련

node_modules --> 자동으로 깔린 모듈들

src ==> 파일들

 

index.js > 몇줄 지움

 

index.js, app.js 빼고 모두 삭제

app.js에 남는 내용:

import React from "react";

 

function App() {

  return <div className="App" />;

}

 

export default App;

 

반응형