We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8da122d + 835b0e8 commit daf7df6Copy full SHA for daf7df6
docs/tutorials/quick-start.mdx
@@ -167,12 +167,17 @@ import { configureStore } from '@reduxjs/toolkit'
167
// highlight-next-line
168
import counterReducer from '../features/counter/counterSlice'
169
170
-export default configureStore({
+export const store = configureStore({
171
reducer: {
172
173
counter: counterReducer,
174
},
175
})
176
+
177
+// Infer the `RootState` and `AppDispatch` types from the store itself
178
+export type RootState = ReturnType<typeof store.getState>
179
+// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
180
+export type AppDispatch = typeof store.dispatch
181
```
182
183
### Use Redux State and Actions in React Components
0 commit comments