WECODE에서의 첫번째 클론코딩 & 첫 팀 프로젝트를 진행하였다.모든것이 처음이였던 CRA 초기 세팅과 JSX, state&props를 이용한 Component분리까지 기록하며 재정리를 해보려한다.
프로젝트의 시작:: 팀원들과의 CRA 초기 세팅
master branch
에 push해야한다.clone
받고 각자의 이름으로 branch
(ex. feature/joonsikyang)를 생성한다.리액트 프로젝트를 시작하는데 필요한 개발환경을 세팅해주는 도구
✔️ CRA 설치
// 원하는 directory 이동 후 CRA 프로젝트를 설치 한다.
// ex. cd Desktop/wecode > npx create-react-app westagram-project
$ npx create-react-app westagram-project
✔️ React Router 설치
$ npm install react-router-dom --save
✔️ Sass 설치
npm install node-sass@4.14.1 --save
✔️ .eslintcache 파일 .gitignore에 추가
// .gitignore
.eslintcache
✔️ CRA 폴더 및 파일 구성
// 재원's 컴포넌트
import LoginJaewon from './pages/jaewon/Login/Login';
import MainJaewon from './pages/jaewon/Main/Main';
// 미미's 컴포넌트
import LoginMimi from './pages/mimi/Login/Login';
import MainMimi from './pages/mimi/Main/Main';
// import 한 컴포넌트에 대한 경로를 각각 설정해준다.
<Route exact path='/login-jaewon' component={LoginJaewon} /><Route exact path='/main-jaewon' component={MainJaewon} /><Route exact path='/login-mimi' component={LoginMimi} /><Route exact path='/main-mimi' component={MainMimi} />
data 폴더
// 초기세팅 작업 완료 후
// add > commit
git add .
git commit -m "Add: first commit. 초기 세팅 완료."
// 설치한 CRA 프로젝트와 github repo를 연동시켜준다.
git remote add origin (해당 repo 주소 입력)
// 연동된 repository로 push
git push origin master
// 초기세팅 완료 후 git clone 진행
git clone (해당 repo 주소 입력)
npm install > node-modules 폴더 생성(패키지 소스코드 생성)
git branch feature/(브랜치명)