tRPCttRPC
Powered by
nehalistN
tRPC•4y ago
nehalist

SSR and loading indicators - I don't get it

Guess I'm missing something here, but unfortunately I'm having a hard time with the docs: in https://trpc.io/docs/v10/nextjs the example
utils/trcp.ts
utils/trcp.ts
sets
ssr: true
ssr: true
, but the
pages/index.tsx
pages/index.tsx
example uses

  const hello = trpc.hello.useQuery({ text: 'client' });
  if (!hello.data) {
    return <div>Loading...</div>;
  }
  const hello = trpc.hello.useQuery({ text: 'client' });
  if (!hello.data) {
    return <div>Loading...</div>;
  }


Since SSR would prevent the page from being rendered until the queries are done, how would this loading indicator ever been shown?
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

Don't understand cache
VengeanceVVengeance / ❓-help
2y ago
TypeScript Alias Imports don't get resolved ont the Client
zirkelcZzirkelc / ❓-help
3y ago
Is it good choice to use tRPC if I don't use monorepo?
tort6334Ttort6334 / ❓-help
2y ago
Nextjs SSR
Jack DelamouJJack Delamou / ❓-help
4mo ago