상세 컨텐츠

본문 제목

checkpoints in react

Programming/React

by 쌩우 2019. 6. 14. 19:38

본문

리액트란 무엇인가?

: Javascript의 라이브러리로써, 선언적인 component와 재사용 가능한 component를 기반으로 구축된다.

JSX에서 Javscript의 변수 name이라는 것을 사용하려면?

: <h1>Hello, {name}</h1>

props란?

: props 원소의 이름을 특정지을 수 있다.

state의 특징은?

: 자신이 아닌 다른 컴포넌트의 state는 알 수 없다. 만약 다른 컴포넌트의 state에 뭔가 영향을 주고 싶다면, 부모 컴포넌트까지 가서 setState 시킨 값을 내려주어야 한다. 급할수록 돌아가야 한다!

functional component와 비교하여 class component의 차이점은?

  1. Life Cycle API를 사용할 수 있다.
  2. state를 가진다.
  3. React.Component로부터 상속받는다.

Life Cycle의 method들로는 무엇이 있는가?

  1. componentDidMount
  2. componentDidUpdate
  3. componentWillUnmount
  4. render

state가 변경되는 불리는 Life Cycle method는?

: componentDidUpdate, render

render method 내에서 setState method를 실행시키면?

: Stack overflow error 발생!!!

'Programming > React' 카테고리의 다른 글

React app 개발 시의 고려 사항  (0) 2019.06.18
recast.ly - React  (0) 2019.06.14
Components and Props - React  (0) 2019.06.11
Rendering Elements - React  (0) 2019.06.11
JSX - React  (0) 2019.06.11

관련글 더보기

댓글 영역