T3 App directory: can't use tRPCs useQuery hook
Even though the component is client side, any idea?
createTRPCProxyClientimport { api } from "~/trpc/server";?createTRPCProxyClientimport { api } from "~/trpc/server";"use client"
export default function MyAmazingComponent() {
const theAmazingQuery = api.myAmazingRouter.getAll.useQuery(); <-- useQuery is not a thing!!
return <></>;
}"use client";
import { useDisclosure } from "@mantine/hooks";
import { AppShell, Burger, Group, } from "@mantine/core";
import { type ReactNode, useState } from "react";
import { LinksGroup } from "./_components/mantine_components/NavbarLinksGroup";
import { IconSchool } from "@tabler/icons-react";
import { api } from "~/trpc/server";
export const Shell = ({ children }: { children: ReactNode }) => {
const schoolQuery = api.school.getAll.useQuery(); // <--- ⚠️ Error here, method not found
const [opened, { toggle }] = useDisclosure();
return (
<AppShell
header={{ height: 60 }}
navbar={{ width: 300, breakpoint: "sm", collapsed: { mobile: !opened } }}
padding="md"
>
<AppShell.Header>
<Group h="100%" px="md">
<Burger opened={opened} onClick={toggle} hiddenFrom="sm" size="sm" />
School again
</Group>
</AppShell.Header>
<AppShell.Navbar p="md">
<LinksGroup
label={"Schools"}
icon={IconSchool}
links={[
{ label: "hi", link: "/" },
]}
/>
</AppShell.Navbar>
<AppShell.Main>{children}</AppShell.Main>
</AppShell>
);
};