<body>
<Top></Top>
<Sidebar></Sidebar>
<body>
npm install create-react-app
sudo npm install create-react-app
npx create-react-app "디렉토리명"
터미널에서
npm start
명령어로 실행
ctrl + c로 종료
npm start
하면 index.html파일이 보임<div id="root"></div>
가 있음. 여기에 컴포넌트들이 들어가게 돼있음.ReactDom.render(<App />, document.getElementById('root'));
로 App 컴포넌트를 불러옴import './App.css';
npm run build
하면 build 디렉토리가 생기고 안에 index.html이 있음. 프로덕션 환경에서 보이는 불필요한 파일이 제거된 것임.npm install -g serve
또는 npx serve -s build
하면 간단한 로컬서버를 사용해서 배포결과를 볼 수 있음(network pannel에서 개발환경에서 보다 용량이 작다는 것을 확인할 수 있음)