We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When explaining how to type hooks, you import a type that doesn't exist :
import { useDispatch, useSelector, useStore } from 'react-redux' import type { AppDispatch, AppStore, RootState } from './store'. <===== AppStore doesn't exist in ./store // Use throughout your app instead of plain `useDispatch` and `useSelector` export const useAppDispatch = useDispatch.withTypes<AppDispatch>() export const useAppSelector = useSelector.withTypes<RootState>() export const useAppStore = useStore.withTypes<AppStore>()
This is the store file as you wrote it at the beginning of the section :
import { configureStore } from '@reduxjs/toolkit' // ... export const store = configureStore({ reducer: { posts: postsReducer, comments: commentsReducer, users: usersReducer } }) // Infer the `RootState` and `AppDispatch` types from the store itself export type RootState = ReturnType<typeof store.getState> // Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState} export type AppDispatch = typeof store.dispatch
There's no mention of AppStore in this file, thus you import it in the hook file
AppStore
The text was updated successfully, but these errors were encountered:
raised #4704 to fix, thanks!
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
What docs page needs to be fixed?
What is the problem?
When explaining how to type hooks, you import a type that doesn't exist :
This is the store file as you wrote it at the beginning of the section :
There's no mention of
AppStore
in this file, thus you import it in the hook fileWhat should be changed to fix the problem?
The text was updated successfully, but these errors were encountered: