본문 바로가기
카테고리 없음

React Tutorial

by ormgm 2020. 3. 21.

https://reactjs.org/tutorial/tutorial.html#help-im-stuck

 

Tutorial: Intro to React – React

A JavaScript library for building user interfaces

reactjs.org

  • we want the Square component to “remember” that it got clicked, and fill it with an “X” mark. To “remember” things, components use state.
  • React components can have state by setting this.state in their constructors. this.state should be considered as private to a React component that it’s defined in.
  • 함수 컴포넌트는 더 간단하게 컴포넌트를 작성하는 방법이며 state없이 render 함수만을 가진다. React.Component를 확장하는 클래스를 정의하는 대신 props를 입력방아서 렌더링할 대상을 반환하는 함수를 작성할 수 있다.

댓글