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.
![Reasons React renders](https://i0.wp.com/www.bitnative.com/wp-content/uploads/2020/07/reasons-react-renders-1.png?fit=640%2C360&ssl=1)
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