re: Sharing state using React's Context API VIEW POST

FULL DISCUSSION
 
 
 

But I still don't see why people say that Redux is complicated, the basics of it are pretty simple. If the problem is "manage shared or global state" and Redux is a well-known solution (and not that hard to understand or implement), then why reinvent the wheel.

Especially since the alternative solutions (based on context or whatever) also tend to increase in complexity with time, and finally you end up with something like ... Redux!

(if you really want a dead simple solution then just import a Javascript module and keep your state there)

 

to learn and evolve. yes, redux is super simple. react-redux is a bit more complex. redux-thunk/sagas are essentials for good business logic split. but at the end you forget where you need to write this piece of code and where you have to. redux is awesome solution - look at how long it is there and it hasn't changed much. but we are much more powerful now, then 3 years ago.

Yes, sometimes it can be refreshing to try something new or use an alternative way ... if we didn't think like that then we'd still be doing COBOL with punch cards. On the other hand, I sometimes have the feeling that we're going around in circles and essentially end up where we were before :-)

 

I am also making my own redux-like state management with context (and hooks) 😀

 

Haha yeah. I think most people jump on the Redux hype train, realize that they over engineered their apps, and then look for simpler options.

I like that your post goes more into how to create a store. I find the context API hard to understand at first so I decided to make a basic intro into using it.

code of conduct - report abuse