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!