We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e46eb99 commit 071b28dCopy full SHA for 071b28d
docs/rtk-query/usage-with-typescript.mdx
@@ -593,7 +593,7 @@ When using `fetchBaseQuery`, the `error` property returned from a hook will have
593
If an error is present, you can access error properties after narrowing the type to either `FetchBaseQueryError` or `SerializedError`.
594
595
```tsx no-transpile
596
-import { api } from './services/api'
+import { usePostsQuery } from './services/api'
597
598
function PostDetail() {
599
const { data, error, isLoading } = usePostsQuery()
@@ -613,10 +613,9 @@ function PostDetail() {
613
<div>{errMsg}</div>
614
</div>
615
)
616
- } else {
617
- // you can access all properties of `SerializedError` here
618
- return <div>{error.message}</div>
619
- }
+ }
+ // you can access all properties of `SerializedError` here
+ return <div>{error.message}</div>
620
}
621
622
if (data) {
0 commit comments