TanStackT
TanStack3mo ago
4 replies
rubber-blue

Prevent useSuspenseQuery throw

Hi all.

The thing is that I have a suspense query that get's an array which I use to build up a navigation.
I've got static navigation items and with the suspense query I check if dynamic children should be added.

The thing is if the suspense query fails then it throws and I can't do the rendering of the app since it's the apps main navigation and pretty much at the top in rendering.

Is there a way to prevent the throw ( if the API for the query is not available ) and render the navigation without the children?

Any info would help.

Reading the docs I haven't found the info on a possibility.
Was this page helpful?