1

When using tRPC with ssr it uses getInitialProps, which has kinda of a cool effect in terms how a page is rendered, since it's rendered server-side on initial requests and client-side on route transitions. Unfortunately, enabling ssr means that you can no longer use getServerSideProps (which I know is only fixable by next.js and not tRPC). But how to replicate the getInitialProps behaviour then?

Let's say I'm building a blog; due to SEO it's basically necessary to render my posts server-side. But when navigating through the site loading posts on the fly would be totally fine. How to do that without ssr?

nehalist
  • 1,434
  • 18
  • 45
  • _"enabling ssr means that you can no longer use getServerSideProps"_ - I'm not sure I follow, `getServerSideProps` is used for SSR. Why can you not use `getServerSideProps`? – juliomalves Nov 13 '22 at 00:53

0 Answers0