- 앱을 개발하다 보면, 어떤 컴포넌트들은 React외부의 시스템을 제어하거나, 해당 시스템과 동기화 해야 하는 경우들이 있다. 예를들어, 브라우저 API를 이용해 input을 focus해야 할수도 있고, 비디오 플레이어를 제어해야 할 수도 있고, 외부 서버와 연결하고 메시지를 받아야 할 수도 있다.
- 이 챕터는 React에서 벗어나 외부 시스템과 연결하는 방법에 대해 다룬다. (가능하다면 앱의 대부분의 로직이나 데이터 플로우가 이런 기능들에 의존하지 않는 것이 좋다고 한다 - 그래서 “불필요한 이펙트 제거하기” 같은 내용도 다루는 거겠지. 필요할 때가 언제인지 정확히 이해하고 필요한 경우에만 사용하는 것이 중요하다는 것을 강조하는 것 같다)
1. How to “remember” information without re-rendering (Referencing values with refs)
2. How to access DOM elements managed by React (Manipulating the DOM with refs)
3. How to synchronize components with external systems (Synchronizing with Effects)
4. How to remove unnecessary Effects from your components (You Might Not Need An Effect)
5. How an Effect’s lifecycle is different from a component’s (Lifecycle if reactive effects)
6. How to prevent some values from re-triggering Effects (Separating events from Effects)
7. How to make your Effect re-run less often (Removing Effects dependencies)
8. How to share logic between components (Reusing logic with custom Hooks)