- 앱의 규모가 커질수록, state 구조를 관리하고 컴포넌트 간의 데이터 흐름flow을 제대로 이해하고 설계하는 것이 중요하다. 중복되거나 복제된 state는 흔한 버그 원인이 된다.
- 이 챕터는 state 구조를 잘 설계할 수 있는 방법, state update logic을 maintainable하게 유지할 수 있는 방법, 그리고 멀리 떨어진 컴포넌트 간에 state를 공유할 수 있는 방법에 대해 다룬다.
1. How to think about UI changes as state changes (Reacting to input with state)
2. How to structure state well (Choosing the state structure)
3. How to “lift state up” to share it between components (Sharing state between components)
4. How to control whether the state gets preserved or reset (Preserving and resetting state)
5. How to consolidate complex state logic in a function (Extracting state logic into a reducer)
6. How to pass information without “prop drilling” (Passing data deeply with context)
7. How to scale state management as your app grows (Scaling up with reducer and context)