State Management · Middle · Question 7 of 75

A component uses only theme from a big AppContext but re-renders on every cart update. What helps?

Explanation

React.memo doesn't stop re-renders caused by a context the component reads. Separate ThemeContext and CartContext limit updates to the consumers that need them. For very frequent updates, use a store with selectors.

Further reading

Problem with a question

State Management · Middle · question 7

Test yourself

Take the State Management · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz