Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 721
Darkpsinight Avatar asked Nov 30 '25 01:11

Darkpsinight


2 Answers

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

like image 159
Daniel Avatar answered Dec 01 '25 14:12

Daniel


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 ...

like image 45
Moein moeinnia Avatar answered Dec 01 '25 15:12

Moein moeinnia