DEV Community

Cover image for Getting started with state management using useReducer and Context

Getting started with state management using useReducer and Context

Emma Goto πŸ™ on June 11, 2020

Choosing a state management library for your React app can be tricky. Some of your options include: Using React’s useReducer hook in combination ...
Collapse
Β 
axelledrouge profile image
AxelleDRouge β€’

Great, thank you that is exactly what I need to improve my work

Collapse
Β 
emma profile image
Emma Goto πŸ™ β€’

Glad to hear, let me know if you have any questions πŸ™‚

Collapse
Β 
axelledrouge profile image
AxelleDRouge β€’

No problem, I will :)

Collapse
Β 
wobsoriano profile image
Robert β€’

Bookmarking for my next React project. react-tracked looks great!

Collapse
Β 
emma profile image
Emma Goto πŸ™ β€’

I actually hadn't heard of it until I was Googling for workarounds to Context's re-render problem! I'm curious if many people use it in their apps or if people jump straight to something like Redux πŸ€”

Collapse
Β 
wobsoriano profile image
Robert β€’

Same thoughts.

I'm checking out easy-peasy for now as it is more friendly at least for me. πŸ˜€

Thread Thread
Β 
emma profile image
Emma Goto πŸ™ β€’

Wow, I wonder how many state management libraries are out there because I hadn't heard of that one either! I might check that one out too πŸ˜„

Collapse
Β 
anderspk profile image
anderspk β€’

Nice article!
Just a question though, because in most tutorials I see using context, the app is so small that the direct children of the entire app use context. I was wondering, in a larger app, should the Provider always be at the top in app.js, or only in the parent of the children that require the state?

Collapse
Β 
emma profile image
Emma Goto πŸ™ β€’

Good question! The context doesn't need to be at the top of the app, you can put it anywhere where it's needed.

Collapse
Β 
vaibhavkhulbe profile image
Vaibhav Khulbe β€’

Nicely written! πŸ’―

Collapse
Β 
emma profile image
Emma Goto πŸ™ β€’

Thank you!