# STATE vs PROPS
* State : POJO{} mutable to store changing component data
- 컴포넌트에 변형되는 데이터를 저장시 선언
* props : POJO{} mutable to store component configuration
- 컴포넌트의 구성 저장시 선언
## State as Props
- parent component passing down its state values as props to stateless child components.
class CountParent extends Component {
constructor(props) {
super(props);
this.state = {count:5};
}
render() {
// passing down parent state as a prop
return (
<CountChild count={this.state.count} />
);
}
}
'react' 카테고리의 다른 글
More State : setting state using state (0) | 2020.06.13 |
---|---|
State clicker exercise : who is lucky (0) | 2020.06.13 |
React Events! (0) | 2020.06.13 |
Introducing State (0) | 2020.06.13 |
Props : styling (0) | 2020.06.13 |