React Class Components and State


React Class Components and State

기존에 있던 function 말고도 class를 활용할 수 있다. class를 이용하면 react가 자동적으로 실행 class APP은 react component다 component를 만들 때마다 모든 것을 구현하고 싶지 않기에 extend from을 한다. function이 아니이게 return은 없고 render method를 가진다. react component는 render method를 가지고 있지만 extend from을 했기에 render methode가 있다. function component는 function이고 return 하고 screen에 표시됨, class comp react는 자동적으로 모든 class component의 render method를 실행한다. 자동적으로! 자동적으로!! state는 object이고 component의 data를 넣을 공간이 있고 이 데이터는 변한다. 바꿀 데이..........



원문링크 : React Class Components and State