Simplify the `useAppDispatch` definition
patel-himanshu opened this issue · 2 comments
patel-himanshu commented
What docs page needs to be fixed?
- Section: Usage with TypeScript
- Page: https://redux.js.org/usage/usage-with-typescript#typing-the-usedispatch-hook
What is the problem?
The current definition of useAppDispatch
can be shortened. Currently, it is:
export const useAppDispatch = () => useDispatch<AppDispatch>();
What should be changed to fix the problem?
It can be reduced to
export const useAppDispatch: () => AppDispatch = useDispatch;
markerikson commented
Hah, I think #4372 beat this one, and also has a PR :)
But, we have the same "TS Quick Start" page over in the React-Redux and Redux Toolkit repos. Can you update those?
patel-himanshu commented
Yeah, sure.