T
tRPC

How can I enable experimental Suspense on NextJS

How can I enable experimental Suspense on NextJS

Ggwilliamnn8/9/2023
O have a project with trpc (v.10^) and nextjs 13, and I wanna test the suspense query, but not show for me, just the normal useQuery.
Jjulius8/10/2023
What version? In the early versions you set a flag when creating the hooks, now it’s enabled by default. Can’t remember which version we made it default but otherwise do this:
const trpc = createTRPCNext<AppRouter, unknown, “ExperimentalSuspense”>({
config() { … }
});
const trpc = createTRPCNext<AppRouter, unknown, “ExperimentalSuspense”>({
config() { … }
});

Looking for more? Join the community!

T
tRPC

How can I enable experimental Suspense on NextJS

Join Server