We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cac910 commit ef57856Copy full SHA for ef57856
docs/usage/UsageWithTypescript.md
@@ -65,10 +65,12 @@ export const store = configureStore({
65
})
66
67
// highlight-start
68
+// Get the type of our store variable
69
+export type AppStore = typeof store
70
// Infer the `RootState` and `AppDispatch` types from the store itself
-export type RootState = ReturnType<typeof store.getState>
71
+export type RootState = ReturnType<AppStore['getState']>
72
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
-export type AppDispatch = typeof store.dispatch
73
+export type AppDispatch = AppStore['dispatch']
74
// highlight-end
75
```
76
0 commit comments