From 59404152898c6c7adec31c6c699876a30a7fb11d Mon Sep 17 00:00:00 2001 From: Eng Zer Jun Date: Sat, 8 Apr 2023 03:15:41 +0800 Subject: [PATCH] docs(react): fix typo in TypeScript.md (#5239) Signed-off-by: Eng Zer Jun --- docs/react/typescript.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/react/typescript.md b/docs/react/typescript.md index 10752d6fe4..fb155aee83 100644 --- a/docs/react/typescript.md +++ b/docs/react/typescript.md @@ -98,14 +98,14 @@ const { error } = useQuery({ queryKey: ['groups'], queryFn: fetchGroups }) [//]: # 'Playground5' -If you want to throw a custom error, or something that isn't an Error at all, you can specify the type of the error field: +If you want to throw a custom error, or something that isn't an `Error` at all, you can specify the type of the error field: ```tsx const { error } = useQuery(['groups'], fetchGroups) // ^? const error: string | null ``` -However, this has the drawback that type inference for all other generics of `useQuery` will not work anymore. It is generally not considered a good practice to throw something that isn't and `Error`, so if you have a subclass like `AxisError` you can use _type narrowing_ to make the error field more specific: +However, this has the drawback that type inference for all other generics of `useQuery` will not work anymore. It is generally not considered a good practice to throw something that isn't an `Error`, so if you have a subclass like `AxiosError` you can use _type narrowing_ to make the error field more specific: ```tsx import axios from 'axios'