honey_pot
[React.js] 본문
REACT CONCEPTS
1. Don't touch the DOM. I'll do it (Declarative not imperative)
2. Build websites like lego blocks
3. Unidirectional data flow : virtualDOM , one way data flow
4. UI, The rest if up to you
REACT KEYWORDS
- Declarative
- JSX
- Components
- Props
- State
- VirtualDOM
THE JOB OF A REACT DEVELOPER
1. Decide on Components
2. Decide the State and where it lives
3. What changes when state changes
npx create-react-app monsters-rolodex
그 폴더에서 yarn start
vscode 에서 터미널 실행하려면 yarn start가 아니라 npm start라고 해야함
npm run build ( build 생성 -> deploy application)
extensions : React Developer Tools
BABEL : 코드가 모든 웹브라우저와 버전에서 구동되게 함
webpack : module bundler
index.js의
import React : html을 syantax처럼 js에 쓸 수 있게 해줌
import ReactDOM : 진짜 DOM과 상호작용하는 역할
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
id="root" 인 부분을 <App/>으로 replace