React·100 questions

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?

More questions in this topic

Related questions from other topics