t3-oss / create-t3-turbo

Clean and simple starter repo using the T3 Stack along with Expo React Native
https://turbo.t3.gg
MIT License
4.57k stars 384 forks source link

Move `api` to `@acme/api` #954

Closed ahkhanjani closed 5 months ago

ahkhanjani commented 6 months ago

By moving this line:

export const api = createTRPCReact<AppRouter>();

from apps/nextjs/src/trpc/react.tsx to packages/api we can make it usable in other React based packages that rely on API calls. Also reduces duplication in Next.js packages.

juliusmarminge commented 5 months ago

Now were making the api depend on trpc/client and React query which i dont think makes much sense

If you want to call the api from some package maybe you should make some "React" package where you share react hooks etc and then it might make sense to have this in there