Open KyleJune opened 2 years ago
I found the following in react-query ssr documentation. It sounds like I may need to use queryClient.fetchQuery
instead of useQuery
to be able to handle the errors on the server without using the error boundary. If there is a way to use the error boundary I would doing that to keep the code simple.
https://react-query.tanstack.com/guides/ssr#only-successful-queries-are-included-in-dehydration
Currently if you click the invalid or negative post links with javascript disabled, it will return an internal server error. That's because error boundaries do not work on the server which results in the error going unhandled. The page should render like it would if navigating to the page from within the browser and the try again link should refresh the page when javascript is disabled.