DEV Community

Hann Htay
Hann Htay

Posted on • Edited on

1

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.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay