loading...

re: Pitfalls of overusing React Context VIEW POST

FULL DISCUSSION
 

Having one global context for an app is like providing a full state for every connected component in redux version. In both versions every context consumer/connected component will be re-rendered on any context/state update.
With react-redux it's important to connect a component to minimum slice of a global state to avoid unnecessary re-renders. The similar rule is true for contexts - keep separate contexts for every logical part of an app and avoid using unnecessary contexts in the components.

code of conduct - report abuse