How to avoid unnecessary rerenders due to Context?
Answer
•Create multiple contexts instead of one large.
•Pass primitives or memoized objects.
•Wrap providers closer to consumers.
•Move logic to store/selectors.
•Check with a profiler.
Was this answer helpful?