TanStackT
TanStack4y ago
4 replies
precious-lavender

Handling 404 on fetch

If I had a query, something like the below in my view user page
const { data: user } = userQueries.getUser('1234'); // just a basic query to get the user based on the prop

Where this will actual throw a 404 error, what would be the best way for me to redirect from the current page (UserView) back to the main table page (UserIndex)? Probay important to note that userQueries comes from a composable outside of the component
Was this page helpful?