Replies: 3 comments
This comment was marked as spam.
This comment was marked as spam.
-
|
@harshagarwalnyu Thanks for the answer. @TkDodo Are you able to confirm above? I found your comment with your thoughts about the feature nowadays and I'm afraid that you have changed your mind regarding this and the flag in general. |
Beta Was this translation helpful? Give feedback.
-
|
The Is it safe to use?
The Recommended Alternative:If you need conditional Suspense behavior in a stable, production-grade manner, the TanStack team recommends either:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We just started implementing Suspense on some views. In the majority of cases, we can use
useSuspenseQueryfor our queries since they are fetching initial and crucial data. But some of the queries we use simultaneously are dependent on certain conditions — i.e., we won't always have authenticated user data, because we don't always require authentication.The perfect solution for keeping
Suspenseapplied for loading states and preserving possibly undefined data in conditionally enabled queries is to useReact.useconditionally together with the promise returned from useQuery. Unfortunately, it turned out that this feature is still experimental.Is it generally safe to use this experimental feature at this stage without concerns about the experimental
useQuerybehavior breaking the logic or behaving unpredictably?Also, what's the current status? How is it developing, and what direction is it heading in at the moment?
Beta Was this translation helpful? Give feedback.
All reactions