DEV Community

Hann Htay
Hann Htay

Posted on • Updated on

Should I learn Redux or use Context Hook in React js,

Image description

Top comments (1)

Collapse
 
peerreynders profile image
peerreynders

TL;DNR: Context is a means by which an external state management capability can be acquired (e.g. get a hold of Redux to subscribe to the store; the "value" in Context used to subscribe to the store never changes while the application is running). Context itself is not for state management.

Why React Context is Not a "State Management" Tool (and Why It Doesn't Replace Redux)

Quote:

...context is ready to be used for low frequency unlikely updates (like locale/theme)... It's not ready to be used as a replacement for all Flux-like state propagation.

If you decide to look into Redux, Mark Erikson recommends to start with Redux Toolkit.