FRONT-END/React

[ReactJS] Props, State, Redux

이리53 2021. 9. 25. 00:26
Props vs State

 

props are read-only
props can not be modified

state changes can be asynchronous
satae can be modified using this.setState

 

Redux

 

Without Redux
상위 컴포넌트가 하위 컴포넌트에게 명령 : props
하위 컴포넌트가 상위 컴포넌트에게 명령 : event

With Redux
데이터를 분산하여 저장X

하나의 저장소에 모든 데이터 저장
특정 값이 바뀌면, 관련된 모든 컴포넌트가 알아서 바뀌게 하는