File tree Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Original file line number Diff line number Diff line change @@ -40,22 +40,6 @@ const store = configureStore({
40
40
export type RootState = ReturnType <typeof store .getState >
41
41
` ` `
42
42
43
- Note that passing the reducers directly is not recommended when you need to add custom middleware,
44
- because this can cause a circular reference in TypeScript:
45
-
46
- ` ` ` typescript
47
- import { configureStore } from ' @reduxjs/toolkit'
48
- import rootReducer from ' ./rootReducer'
49
- const store = configureStore ({
50
- reducer: rootReducer ,
51
- middleware: [
52
- ... customMiddleware ,
53
- ... getDefaultMiddleware <RootState >(),
54
- ] as const ,
55
- })
56
- // TS2456: Type alias 'RootState' circularly references itself.
57
- export type RootState = ReturnType <typeof store .getState >
58
- ` ` `
59
43
60
44
### Getting the ` Dispatch ` type
61
45
You can’t perform that action at this time.
0 commit comments