React HooksLesson 53Free preview
React useMemo
This lesson is part of React · All levels
Summary
UseMemo returns the value of the already-memoized computation result so that it is only recalculated when the dependencies change. It's great for expensive processes like filtering thousands of data or formatting complex data formats. Use it after there's actually a performance problem, not as a habit from the start.
Key points
- The shape
- Preventing repeated weight calculations on each render
- Returns a value, unlike useCallback which returns a function
- An incomplete dependence can create a worthless value
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.