I'll point out my usual caveat whenever the "replace Redux with useReducer" discussion comes up:
Context has limitations with how it handles updates, specifically around components not being able to skip re-renders. Also, React-Redux has very different update characteristics because it uses store subscriptions.
You are absolutely right, and Iβm not suggesting to never use Redux again, Iβm a big fan of Redux, especially coupled with Redux-Saga or Redux-Observable π
But I enjoy a lot reimplementing some libraries I use, especially when beginners find them complex at first sight. This is mostly for an educational purpose. For the same reason, I wrote another post a while ago about implementing Redux (again) and Redux-Saga: Lost with Redux and sagas? Implement them yourself!
I'll point out my usual caveat whenever the "replace Redux with
useReducer
" discussion comes up:Context has limitations with how it handles updates, specifically around components not being able to skip re-renders. Also, React-Redux has very different update characteristics because it uses store subscriptions.
See my posts React, Redux, and Context Behavior and A (Mostly) Complete Guide to React Rendering Behavior for complete details on the differences.
Thanks for the additional information π
You are absolutely right, and Iβm not suggesting to never use Redux again, Iβm a big fan of Redux, especially coupled with Redux-Saga or Redux-Observable π
But I enjoy a lot reimplementing some libraries I use, especially when beginners find them complex at first sight. This is mostly for an educational purpose. For the same reason, I wrote another post a while ago about implementing Redux (again) and Redux-Saga: Lost with Redux and sagas? Implement them yourself!
Actually, Context API and Hooks drawback is that re-rendering happens although there are many solutions including the one inspired by Dan Abramov and here you go :
1- github.com/facebook/react/issues/1...
2- blog.axlight.com/posts/benchmark-r...
3.... COME AND THANK ME :P
twitter : @MokhtarMegherbi