Skip to content

Commit

Permalink
Update ConfiguringYourStore.md
Browse files Browse the repository at this point in the history
`getDefaultMiddleware` has been marked as deprecated.

Prefer to use the callback notation for the middleware option in configureStore to access a pre-typed getDefaultMiddleware instead.
  • Loading branch information
koechkevin authored Oct 20, 2023
1 parent 957aed6 commit 88e4f7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/usage/ConfiguringYourStore.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ By default, `configureStore` from Redux Toolkit will:
Here's what the hot reloading example might look like using Redux Toolkit:

```js
import { configureStore, getDefaultMiddleware } from '@reduxjs/toolkit'
import { configureStore } from '@reduxjs/toolkit'

import monitorReducersEnhancer from './enhancers/monitorReducers'
import loggerMiddleware from './middleware/logger'
Expand All @@ -356,7 +356,7 @@ import rootReducer from './reducers'
export default function configureAppStore(preloadedState) {
const store = configureStore({
reducer: rootReducer,
middleware: [loggerMiddleware, ...getDefaultMiddleware()],
middleware: (getDefaultMiddleware) => [loggerMiddleware, ...getDefaultMiddleware()],
preloadedState,
enhancers: [monitorReducersEnhancer]
})
Expand Down

0 comments on commit 88e4f7e

Please sign in to comment.