GirbiG
tRPC8mo ago
Girbi

Tprc Tanstack integration types

Hello guys! I wanted to create a reusable query, like this:
export function useProjectBySlug(slug: string, options?: any) {
  const queryOptions = trpc.projects.getBySlug.queryOptions({ slug }, options);
  return useSuspenseQuery(queryOptions);
}

I didn't want to use the same syntax for
queryOptions
all over the place. The problem is i want to pass the correct type for options, not any.
Was this page helpful?