useSuspenseQuery - throw error while having stale data #6960
-
Hello TanStack team! First of all I would like to thank You for Your hard work - TanStack Query is a great tool and I enjoy using it. Example situationConsider a case where we have component which is suppose to always display fresh (not-stale) data.
Problem statementI believe that it could be achieved by using With
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
What you can do is just throw during rendering, without needing a useEffect:
that should trigger the error boundary. It's also in the docs: https://tanstack.com/query/latest/docs/framework/react/guides/suspense#throwonerror-default |
Beta Was this translation helpful? Give feedback.
imo normalization of features only works if we have them behave the same, which we just agreed we cannot do.