trpc .fetch in nextjs app router, does fetch() get deduped?

29 Views Asked by At

Will a .fetch() call on a initTRPC.context, server side, be deduped by the nextjs app router or not?

From nextjs docs: "Passing data between a parent layout and its children is not possible. However, you can fetch the same data in a route more than once, and React will automatically dedupe the requests without affecting performance."

From tan-stack docs: "Next.js already dedupes requests that utilize fetch(), but if you are using something else in your queryFn, or if you use a framework that does not dedupe these requests automatically, using a single queryClient as described above might make sense, despite the duplicated serialization."

0

There are 0 best solutions below