Khi context value thay đổi, mọi consumer re-render dù chỉ dùng một phần.
- Tối ưu: tách context thành nhiều context nhỏ hơn theo concern, memoize context value với useMemo, dùng context selector pattern hay thư viện như use-context-selector.
- Ngoài ra, split static và dynamic context riêng biệt.
When a context value changes, every consumer re-renders even if it only uses a small part of the value.
Optimizations: split context into smaller, focused contexts by concern, memoize the context value with useMemo, use the context selector pattern or a library like use-context-selector, and separate static from dynamic context into different providers.