import { api } from '~/utils/api';

So before I was able to import import { api } from '~/utils/api'; and do something like api.something.method.useMutation..... I now started a new project with T3 stack after a long time of not touching tRPC / Next.js and I am using app router and I can no longer use utils/api. What am I missing ? Thanks!
2 Replies
mvpopuk
mvpopukOP6mo ago
Ohh it was import from @/trpc/react in app router
Ben
Ben6mo ago
Keep in mind, it's import { api } from @/trpc/react when you are fetching data in a client component, but it's import { api } from @/trpc/server when you are fetching data in a server component
Want results from more Discord servers?
Add your server