Skip to content

Commit daf7df6

Browse files
authored
Merge pull request #1913 from jdeb9/fix/named-export
2 parents 8da122d + 835b0e8 commit daf7df6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/tutorials/quick-start.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,17 @@ import { configureStore } from '@reduxjs/toolkit'
167167
// highlight-next-line
168168
import counterReducer from '../features/counter/counterSlice'
169169

170-
export default configureStore({
170+
export const store = configureStore({
171171
reducer: {
172172
// highlight-next-line
173173
counter: counterReducer,
174174
},
175175
})
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
176181
```
177182
178183
### Use Redux State and Actions in React Components

0 commit comments

Comments
 (0)