Pure Components & Avoiding Side Effects in Render
Write render functions that are free of mutations and external reads.
Welcome
In this lesson you will learn what a pure component means in React, why render functions must be free of side effects, and how to spot and fix common purity violations.
What Is a Pure Function?
A pure function always returns the same output for the same inputs and causes no observable side effects. React expects your component function to be pure: given the same props and state, it should always return the same JSX.
All lessons in this course
- What StrictMode Does
- Pure Components & Avoiding Side Effects in Render
- Key & Ref Best Practices
- Folder Structure & Naming Conventions