TanStackT
TanStack2y ago
8 replies
verbal-lime

accessing the queries status triggers <Suspense>?

Hi,
Using the latest solid-query and got a question regarding its interaction with suspense:

Stackblitz repro:
https://stackblitz.com/edit/solid-vite-6v3qxx?file=src%2Findex.tsx

Basically:
How does solid-query interact with suspense boundaries of solid-js.
In this example i am accessing the queries "fetchStatus" which also seems to trigger the <suspense> boundary above.
I've set the "keepPreviousData" as placeholderdata (as per suggesstion in the upgrade-docks).
If that is not done, both bondaries trigger.

How can i achieve not triggering the suspense?

Basic setup i want to do is a searchinput with loading indicator where the results are shown below it. But i'm struggeling as everything seems to trigger the suspense ☹️
Pseudo setup:

<searchinput>
<Show when={query.isLoading}><LoadingIndicator></Show>
<Suspense>
  <Show when={query.data}>
    {query.data.results}
  </Show>
</Suspense>


Any Help would be appreciated
StackBlitzKamehamehaNudel
Starter project for Node.js
solid query (forked) - StackBlitz
Was this page helpful?