JavaScript/React
리액트로 개발할 때 함수형, 클래스형 컴포넌트 차이
Tech Signal
2021. 8. 6. 13:55
클래스형 컴포넌트
- 옛날 문법
- render() 안에서 return
비교
함수형에서 props 접근할 때는 {props.text} vs class에서는 this.props.text
class형의 constructor(), mounted() vs 함수형에서는 hooks로 대체 가능