Skip to content

Commit 3220e1b

Browse files
Update docs/usage/usage-with-typescript.md
Co-authored-by: Lenz Weber <[email protected]>
1 parent 1334799 commit 3220e1b

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

docs/usage/usage-with-typescript.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,6 @@ const store = configureStore({
4040
export type RootState = ReturnType<typeof store.getState>
4141
```
4242
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-
```
5943
6044
### Getting the `Dispatch` type
6145

0 commit comments

Comments
 (0)