Redux
Beginner

configureStore Pattern

Learn how to use configureStore to set up your Redux store with dev tools and middleware.

20 min
2 sections
configurestore
store
setup
1
2

01. Basic Store Setup

Section 1 of 2

configureStore is a friendly abstraction over the standard Redux createStore function. It adds good defaults automatically.

typescript
import { configureStore } from '@reduxjs/toolkit';
import todosReducer from './todos/slice';

export const store = configureStore({
  reducer: {
    todos: todosReducer,
    // add more reducers here
  },
});

// Infer the RootState and AppDispatch types
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;

Exercise

Create a Store

Practice

Create a Redux store with configureStore that includes a todos reducer.

Back to Course