Creates a "pre-typed" version of useDispatch useDispatch where the type of the dispatch function is predefined.
dispatch
This allows you to set the dispatch type once, eliminating the need to specify it with every useDispatch useDispatch call.
The specific type of the dispatch function.
A pre-typed useDispatch with the dispatch type already defined.
useDispatch
export const useAppDispatch = useDispatch.withTypes<AppDispatch>() Copy
export const useAppDispatch = useDispatch.withTypes<AppDispatch>()
9.1.0
Generated using TypeDoc
Creates a "pre-typed" version of useDispatch useDispatch where the type of the
dispatch
function is predefined.This allows you to set the
dispatch
type once, eliminating the need to specify it with every useDispatch useDispatch call.