I'm using a Typescript + Express backend (Node.js, version 18), and a React Native (Typescript) frontend. For some reason by TRPC tanstack-query hooks don't seem to be typing things correctly. I am trying to understand why.
I have a monorepo setup with a file structure like this:
root -frontend -backend
So the frontend and backend files can import from each other, and everything lives under one
.git
.git
in the root.
In my backend, I create a router and export the type:
import {createTRPCReact} from '@trpc/react-query';import type {AppRouter} from 'my/file/path/to/backend';export const trpc = createTRPCReact<AppRouter>();
import {createTRPCReact} from '@trpc/react-query';import type {AppRouter} from 'my/file/path/to/backend';export const trpc = createTRPCReact<AppRouter>();