Skip to content

Commit d955fb2

Browse files
authored
Merge pull request #4379 from in-tech-gration/master
Update usage-with-typescript.mdx
2 parents 90937c1 + 071b28d commit d955fb2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

docs/rtk-query/usage-with-typescript.mdx

+4-5
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ When using `fetchBaseQuery`, the `error` property returned from a hook will have
593593
If an error is present, you can access error properties after narrowing the type to either `FetchBaseQueryError` or `SerializedError`.
594594

595595
```tsx no-transpile
596-
import { api } from './services/api'
596+
import { usePostsQuery } from './services/api'
597597

598598
function PostDetail() {
599599
const { data, error, isLoading } = usePostsQuery()
@@ -613,10 +613,9 @@ function PostDetail() {
613613
<div>{errMsg}</div>
614614
</div>
615615
)
616-
} else {
617-
// you can access all properties of `SerializedError` here
618-
return <div>{error.message}</div>
619-
}
616+
}
617+
// you can access all properties of `SerializedError` here
618+
return <div>{error.message}</div>
620619
}
621620

622621
if (data) {

0 commit comments

Comments
 (0)