I'm following a tutorial for building a full stack React E-commerce site, and after finishing the UI and the backend, the presenter said that we will work now with Redux, and in console he installed two redux packages with npm install @reduxjs/toolkit react-redux.
My question is what is the difference between react-redux and redux-toolkit ?
The react redux package provides the bindings for react (useSelector, useDispatch, etc)
The redux toolkit package is a 'friendly interface' for redux. Definetly go for the toolkit package instead of vanilla redux :)
P.S. the toolkit package provides an out of the box 'object immutability feature' using immer
Redux toolkit has usage while you are debugging your code using Redux DevTools . React-redux has some React hooks and useful methods for working with Redux in React for exp : useSelector , useDispatch and ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With