DEV Community

Albert
Albert

Posted on

Redux or Context API?

Please is advisable to still redux even if you know the context API?

Top comments (3)

Collapse
 
papaponmx profile image
Jaime Rios

If it was a project starting from scratch, I would not use it since with React and Hooks you have a quite similar functionality right out of the box.

Here is a nice video for reference.

Collapse
 
albertdugba profile image
Albert

okay Thank you

Collapse
 
kirillvy profile image
Kirill V

Depends on what you're doing. If you're going on an existing project, it's pretty much guaranteed to have Redux. Context API is good for fairly small apps with few asynchronous actions and dependencies. You also have to keep track of your state structure in both cases.

If you're starting something new and potentially big, you may want to learn about Effector, which gives you both a hooks-based state API and an event bus to tie together different states, as well as subscriptions to asynchronous events ('effects'). As a warning, it's currently not fully documented, so you have to jump between the docs and the GitHub readme to use it effectively.