반응형
리액트 - state

기술개발/React, Frontend 2021. 3. 8. 15:02

(주의!!)본 글은 현재 시점에서는 레거시한 '클래스 컴포넌트'를 공부하며 작성한 글입니다. state props와는 다르게 다른 곳에서 변경을 하면 html dom을 re rendering 시킴(props도 리렌더링 함) state 안에 데이터 값을 입력해 놓고 dom에서 사용 class BusinessName extends React.Component { constructor(props) { super(props); this.state = { brand: '한승욱짱' }; } render() { // const { brand } = this.props; const { brand } = this.state; return ( {/* hello, {brand} */} hello, {brand} ); } 여..

Article Thumbnail
반응형