Запитання 8
How would one optimize the performance of React contexts to reduce unnecessary rerenders?
Варіанти відповідей
By splitting context into state and dispatch contexts, memoizing values, wrapping consumers in React.memo, and using selector libraries.
By avoiding context usage entirely and using only local component state.
By hardcoding all values in context and never updating them.
By directly mutating state inside context providers to avoid rerenders.