examples/.experimental/next-app-dir/README.md
This is a playground repo for an offical tRPC + Next.js App directory adapter.
Note You can already use tRPC with app directory, by:
- using
@trpc/clientdirectly in components (both RSC and non-RSC)- use
@trpc/nextfor client components
Please join our Discord if you want to discuss how we approach this.
If you want to change this repo, you go to https://github.com/trpc/trpc/tree/main/examples/.experimental/next-app-dir
Warning Don't use this in production unless you are okay with large refactoring.
Create a tRPC client that you can use the same way, no matter if you are in a server components
Examples:
Example: /src/app/api/trpc/[trpc]/route.ts
"use client" & "use server".Files of note: