Search code examples
reactjsreduxreact-reduxredux-toolkit

The difference between react-redux and redux-toolkit?


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 ?


Solution

  • 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