From 31f8b9216a868785a88021affd45cfbea94e321c Mon Sep 17 00:00:00 2001 From: Pankaj Boruah <55853250+pankajboruah@users.noreply.github.com> Date: Mon, 29 Aug 2022 20:33:29 +0530 Subject: [PATCH] minor typo (#1950) --- docs/tutorials/typescript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/typescript.md b/docs/tutorials/typescript.md index 139c829b8..00b58a625 100644 --- a/docs/tutorials/typescript.md +++ b/docs/tutorials/typescript.md @@ -73,7 +73,7 @@ export type AppDispatch = typeof store.dispatch ### Define Typed Hooks -While it's possible to import the `RootState` and `AppDispatch` types into each component, it's **better to create typed versions of the `useDispatch` and `useSelector` hooks for usage in your application**. . This is important for a couple reasons: +While it's possible to import the `RootState` and `AppDispatch` types into each component, it's **better to create typed versions of the `useDispatch` and `useSelector` hooks for usage in your application**. This is important for a couple reasons: - For `useSelector`, it saves you the need to type `(state: RootState)` every time - For `useDispatch`, the default `Dispatch` type does not know about thunks. In order to correctly dispatch thunks, you need to use the specific customized `AppDispatch` type from the store that includes the thunk middleware types, and use that with `useDispatch`. Adding a pre-typed `useDispatch` hook keeps you from forgetting to import `AppDispatch` where it's needed.