There are four events that cause a React component to render:
- State change
- Prop change
- Parent render
- Context change
When state changes, you can skip the render via:
When props change or a parent renders, you can skip the render via:
When context changes, React always renders the context’s consumers.
You can also force a render via forceUpdate, but that’s rarely the right approach.
This is a preview of content from my upcoming “Managing React State” course, publishing on Pluralsight late summer 2020. ☀️
More on React
React: The Big Picture
Creating Reusable React Components
Building Applications with React and Redux
Securing React Apps with Auth0