Skip to content

Commit 1dcbf68

Browse files
committed
docs(react): fix typo in TypeScript.md
Signed-off-by: Eng Zer Jun <[email protected]>
1 parent 6260338 commit 1dcbf68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/react/typescript.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ const { error } = useQuery({ queryKey: ['groups'], queryFn: fetchGroups })
9898

9999
[//]: # 'Playground5'
100100

101-
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:
101+
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:
102102

103103
```tsx
104104
const { error } = useQuery<Group[], string>(['groups'], fetchGroups)
105105
// ^? const error: string | null
106106
```
107107

108-
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:
108+
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:
109109

110110
```tsx
111111
import axios from 'axios'

0 commit comments

Comments
 (0)