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

re: I agree with you to keep state locally within the component, if that piece of state is only needed within that component. So don't make state "glob...

Ah I see what you mean.

Yes you're correct, there is no difference in what Redux and Context API are made to do.

I also definitely agree with local state. Don't reach for Context or anything global if your components don't need that yet.

The topic of whether Context is actually simpler or if it's better to use a well-known library like Redux is for another discussion I believe. There's also different ways of implementing Redux so I think even if I make some points against Redux, it may not actually apply to every project that uses Redux.

code of conduct - report abuse