Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.
Exercise 1 of 1
An expensive filter runs on every render — useMemo caches it so it only runs when the inputs change.
Category filter
Unrelated state: 0
ProductList renders: 1
Showing 800 products in All — sorted by price
Click Tick. The filter re-runs even though the category didn't change — you may notice a slight delay. Click a category to see the filter actually do useful work.
Multiple choice — select an answer to see the explanation.
What does useMemo return?