react class constructor (1) 썸네일형 리스트형 React state, hooks UseState State 리액트에서 state는 컴포넌트 내부에서 바뀔 수 있는 값 props는 컴포넌트가 사용되는 과정에서 부모 컴포넌트가 설정하는 값 컴포넌트 자신은 해당 props를 읽기 전용으로 사용 props를 바꾸려면 부모 컴포넌트에서 바꿔야 함 App 컴포넌트에서 MyComponent를 사용할 때 props를 바꾸어 주어야 값이 변경 될 수 있다. MyComponent에서는 전닯다은 name 값을 바꿀 수 없다. src/Counter.js import React, { Component } from 'react'; class Counter extends Component { constructor(props){ super(props); this.state = { number:0 }; } render() { c.. 이전 1 다음