Hello
I am getting TypeError: Cannot read properties of null (reading 'useContext')
When trying to getServerSideProps in next
export const getServerSideProps = () => {
const protect = api.text2img.protect.useQuery();
console.log(protect);
// Pass data to the page via props
return { props: { data: "what" } }
}
3 Replies
I followed the guide here https://trpc.io/docs/ssr
I followed the guide here https://trpc.io/docs/ssr
Server-Side Rendering | tRPC
To enable SSR just set ssr: true in your createTRPCNext config callback.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View