Skip to content
Discussion options

You must be logged in to vote

This makes things hard when your TError is certain, e.g. AxiosError.

is it though? I don't think you can be certain of that. For example, if you have a runtime error in select, your query will also go into Error state with that error. A simple instanceOf Error check, or to use a runtime type guard from axios (axios.isAxiosError(error)) is one line of code.

https://tkdodo.eu/blog/react-query-and-type-script#what-about-error

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@SevenOutman
Comment options

@SevenOutman
Comment options

@TkDodo
Comment options

Answer selected by SevenOutman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants