tRPCttRPC
Powered by
rustclanR
tRPC•4y ago•
3 replies
rustclan

TRPC global loading page

Hey. With trpc/nextjs I'm wondering if its possible to have a global loading context/state which is used across my whole app, whenever a TRPC endpoint
.isFetched
.isFetched
property is false, it will display a "loading" symbol.

Currently I have to do something like this on every page:

  if (!getMailQuery.isFetched) {
    return (
      <AppShell navbar={<AdminNavBar selected={6} />}>
        <PublicLoadingScreen />
      </AppShell>
    );
  }
return (pageContent...)
  if (!getMailQuery.isFetched) {
    return (
      <AppShell navbar={<AdminNavBar selected={6} />}>
        <PublicLoadingScreen />
      </AppShell>
    );
  }
return (pageContent...)
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Cloudflare Page tRPC route
keemKkeem / ❓-help
11mo ago
❌ Failed to collect page data for api trpc [trpc] ❌
AymaneChAAymaneCh / ❓-help
3y ago
Getting global query loading state on client (react)
Mighty EightMMighty Eight / ❓-help
9mo ago
best strategy for handling global trpc errors on the client
v28Vv28 / ❓-help
5mo ago