Performance and Memoization
Part of the React course
Your app has a table with two thousand rows and a search box above it. Every keystroke feels heavy: you type, and half a second later the letter shows up. Nothing is broken, and the code looks reasonable. What is happening is that a single character in the search box makes React run every one of those two thousand row components again, work out that almost none of them changed, and then update the screen.
React re-renders freely on purpose, and most of the time that is exactly right, because running a component function is cheap and React is good at working out the minimum it needs to change on the page. Occasionally it is not right, and for those cases React gives you three tools to say "this result has not changed, reuse the previous one". ...
Want to learn React Performance and Memoization in a real environment?
Click below, get a fresh Linux box with React ready to go, and work through Performance and Memoization hands-on with an AI tutor that knows your code.
Start this lessonPerformance and MemoizationWhat you'll learn
- React.memo for components
- UseMemo for expensive computations
- UseCallback for stable function references
- When memoization is overkill
- Measuring before optimizing
Read this lesson in your language
All lessons in this course
17 lessons- 1What is React?25 min
- 2JSX and Components30 min
- 3Props30 min
- 4State with useState35 min
- 5Handling Events30 min
- 6Conditional Rendering and Lists30 min
- 7Forms and Controlled Inputs35 min
- 8Effects with useEffect40 min
- 9Data Fetching40 min
- 10Component Composition35 min
- 11Context and useContext35 min
- 12useReducer35 min
- 13Custom Hooks35 min
- 14Performance and Memoization35 min
- 15Routing with React Router40 min
- 16Testing React Components40 min
- 17Capstone: Todo App60 min
