@reduxjs/toolkit for the store utilities like createSlice and configureStore, and react-redux for the React bindings like Provider, useSelector, and useDispatch. Both are needed.
How to Set Up Redux Toolkit in a React App From Scratch
What packages do I need for Redux Toolkit?
The answer
More FAQs in How to Set Up Redux Toolkit in a React App From Scratch
Install @reduxjs/toolkit and react-redux, create a slice with createSlice, configure the store with configureStore, wrap your app in a Provider, read state with useSelector, dispatch actions with useDispatch, and handle async with createAsyncThunk.
Use createSlice, defining the initial state and reducers in one place. It auto-generates action creators for you. A cart slice might have an items array and add and remove reducers.
Use the useSelector hook from react-redux, selecting only the part of state you need. Selecting only the slice you need avoids unnecessary re-renders when other parts of state change.
Still have questions?
Browse all our FAQs or reach out to our support team
Want to upskill yourself?
Your learning library
Small steps. Big possibilities.
Find your next course. Build something great.