-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
@reduxjs/toolkit version 1.6.1
I followed the official website and wrote the following code and then i got an error
TypeError: getDefaultMiddleware is not a function
import { configureStore } from '@reduxjs/toolkit';
import counterReducer from './modules/counterSlice';
import logger from 'redux-logger';
export const store = configureStore({
reducer: {
counter: counterReducer,
middleware: (getDefaultMiddleware: any) => getDefaultMiddleware().concat(logger),
},
});
// Infer the `RootState` and `AppDispatch` types from the store itself
export type RootState = ReturnType<typeof store.getState>;
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch;Metadata
Metadata
Assignees
Labels
No labels
