xegld
xegld
TTCTheo's Typesafe Cult
Created by xegld on 9/2/2023 in #questions
useQuery runs on CSR?!
Hi! When I try to build my next app, the useQuery hooks from my pages are triggered and fail with TRPCError (because you have to be authenticated). I am using ssr: false and my pages don't use getStaticProps or getServerSideProps The useQuery should run only on client side as mentioned in https://nextjs.org/docs/pages/building-your-application/rendering/client-side-rendering Any idea how to debug/fix this?
const Page: NextPage = () => {
const {data} = api.test.list.useQuery()

return (<>
{data?.map(item => <p ...>{item.title}</>)
</>)

}
const Page: NextPage = () => {
const {data} = api.test.list.useQuery()

return (<>
{data?.map(item => <p ...>{item.title}</>)
</>)

}
3 replies