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

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

'FRONT-END > React' 카테고리의 다른 글

[React] useState, useEffect  (0) 2021.10.14
[React] Components and Props(official docs)  (0) 2021.09.16