rustclanR
tRPC3y 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 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...)
Was this page helpful?