Reputation: 51
What are the considerations I should be thinking of when it comes to choosing whether to use contexts to manage states in my front end vs using a state management system like Redux? Pros and cons?
Upvotes: 1
Views: 751
Reputation: 218
For my latest app, once global state became overwhelmingly large and complex, I decided to use Redux and Redux Toolkit to separate concerns and:
useSelector
hookstate.variable = something
)I think use cases vary immensely. For instances where you just need to grab some value from up the tree, Context
works great.
Read the docs on both and you will be better able to decide which is appropriate.
Upvotes: 2