Skip to content

Commit 1334799

Browse files
committed
docs: return type of store.getState is needed when rootReducer is missing
1 parent fb5dd97 commit 1334799

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/usage/usage-with-typescript.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ const rootReducer = combineReducers({})
2828
export type RootState = ReturnType<typeof rootReducer>
2929
```
3030
31-
If you pass the reducers directly to `configureStore()`, you can get the `State` type from the store instead.
31+
If you pass the reducers directly to `configureStore()` and do not define the root reducer explicitly, there is no reference to `rootReducer`.
32+
Instead, you can refer to `store.getState`, in order to get the `State` type.
3233
3334
```typescript
3435
import { configureStore } from '@reduxjs/toolkit'

0 commit comments

Comments
 (0)