TanStackT
TanStack16mo ago
2 replies
endless-jade

handling loading and error states

Hi guys, I'm not sure what's the best way to handle loading and error states for a public website. I was thinking of using QueryBoundaries but I'm not sure because:

- i dont wanna show a Big Spinner in most of the pages.
- I need the queries to run asap and avoid loading states (for seo purposes we dont want to show spinners everywhere)
- I need to catch the errors locally(If a component that makes a request throws error, I dont wanna show a whole error component size of the screen)

As summary, the website is public (kinda amazon)

What's the best way to handle loading/error States ?

Using prefetching ?
Using loaders ? (We are using tanstack router)
Using suspended queries?
Was this page helpful?