DEV Community

Discussion on: Using React - Context vs Redux

Collapse
 
rricardocoder profile image
Ricardo el coder

I prefer context instead of redux. Even more when you use context with React hooks, it turns so much easier.

Collapse
 
vvilliam5 profile image
Williams Oluwafemi

Sure might be a breeze if you use them with Hooks, but what about people with a preference for class based components

Collapse
 
dance2die profile image
Sung M. Kim

One thing to note is that, when any data in context changes, any components using the context would be re-rendered.

For Redux, only the components that connects to the changed data is re-rendered.

Collapse
 
bardaxx profile image
Giacomo Alonzi

Yes by if you connect a view to the store, when the store change and the entire view is rerendered is not the same as context?

Thread Thread
 
dance2die profile image
Sung M. Kim

Redux used to used Context for v6, they removed it in v7+ as that was the issue.

Thread Thread
 
bardaxx profile image
Giacomo Alonzi

what u mean?

Collapse
 
vvilliam5 profile image
Williams Oluwafemi

Exactly 10 points for Redux 😁