Skip to content

Commit 2dc6c4e

Browse files
authored
Merge pull request #1926 from patel-himanshu/docs/simplify-useappdispatch
Simplify the useAppDispatch definition
2 parents 7882dfc + f0a2977 commit 2dc6c4e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/tutorials/typescript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ import type { RootState, AppDispatch } from './store'
8686

8787
// highlight-start
8888
// Use throughout your app instead of plain `useDispatch` and `useSelector`
89-
export const useAppDispatch = () => useDispatch<AppDispatch>()
89+
export const useAppDispatch: () => AppDispatch = useDispatch
9090
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector
9191
// highlight-end
9292
```

docs/using-react-redux/usage-with-typescript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ import type { RootState, AppDispatch } from './store'
6969

7070
// highlight-start
7171
// Use throughout your app instead of plain `useDispatch` and `useSelector`
72-
export const useAppDispatch = () => useDispatch<AppDispatch>()
72+
export const useAppDispatch: () => AppDispatch = useDispatch
7373
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector
7474
// highlight-end
7575
```

0 commit comments

Comments
 (0)