Trpc with nextjs 15
using trpc with nextjs 15 makes sense??
im working on a production project
so thinking to use trpc too
but i read in trpc docs that nextjs app router solves lot of problems...
4 Replies
If you like trpc you can go ahead with using it on app router. Worth reading this I think https://trpc.io/docs/client/react/server-components
Set up with React Server Components | tRPC
This guide is an overview of how one may use tRPC with a React Server Components (RSC) framework such as Next.js App Router.
And this https://trpc.io/blog/trpc-actions
Using Server Actions with tRPC | tRPC
The builder-pattern for creating procedures which was introduced in tRPC v10 has been massively appreciated by the community, and many libraries have adopted similar patterns.
Now RSCs themselves solve a lot of typesafe query problems, so as an alternative, just give the RSC the data server side and use https://next-safe-action.dev/ for mutationing actions
Type safe Server Actions in your Next.js project | next-safe-action
next-safe-action is a library for defining end-to-end typesafe and validated Server Actions in Next.js App Router projects.
You can also use trpc quite well with React Router and Tanstack Start if your not married to RSCs