c3epmos 2020. 1. 7. 11:38

Component

component는 HTML을 반환하는 함수이다. react에서는 Javascript와 HTML 사이에 조합을 JSX하고 부른다.

 

index.js

일반적으로 '<App />' 이것을 컴포넌트라고 부른다.

 

src/Potato.js

내가 만든 Potato라는 component이다.

 

src/app.js

react application은 하나의 component만 render할 수 있다. 그래서 potato component는 app.js 안에서 호출할 것이다.

 

출처

https://academy.nomadcoders.co