Redux Toolkit: createSlice and configureStore
Define state slices with createSlice, combine them in configureStore, and dispatch actions from React components using useDispatch and useSelector.
Why Redux Toolkit?
Redux Toolkit (RTK) is the official, opinionated way to write Redux logic. It eliminates the boilerplate of plain Redux: no manual action type strings, no verbose reducers, no complex store setup.
Installing Redux Toolkit
Install both RTK and the React binding.
npm install @reduxjs/toolkit react-reduxAll lessons in this course
- Redux Toolkit: createSlice and configureStore
- Zustand for Lightweight React State
- Pinia for Vue: defineStore and storeToRefs
- When to Use Global vs Local State