T3 for SSG
Does anyone have an example project of a T3 App using SSG? Reading the docs, i am not sure if i should add the SSG Helper context (https://trpc.io/docs/v10/ssg-helpers) somewhere in where the TRPC Settings are defined and have them be imported directly from utils/trpc.
SSG Helpers | tRPC
createProxySSGHelpers provides you a set of helper functions that you can use to prefetch queries on the server.
10 Replies
https://github.com/vothvovo/nextjsdebug I made this a while back because I had a misunderstanding of what SSG actually is, but it's got a working ssg example in there
GitHub
GitHub - vothvovo/nextjsdebug: oof
oof. Contribute to vothvovo/nextjsdebug development by creating an account on GitHub.
you also linked the v10 docs, make sure you have the right version, these are the v9 docs: https://trpc.io/docs/v9/ssg-helpers
SSG Helpers | tRPC
createSSGHelpers provides you a set of helper functions that you can use to prefetch queries on the server.
also if you find out what exactly prefetch does please tell me lol
you should use v10
not v9
I honestly don't know the difference, but I guess choosing the highest version can't be wrong
v10 is the latest stable version
also nicer to use
Well shiat, the example I gave was made in v9
Maybe he can migrate it or someone has an example with v10
it's quite similar
its just
.prefetch
nowTalking about prefetch
Do you know 🥺
oh no just ask alex
my immediate thought is just that it runs on the server lol and passes it along to you
like not that complicated
the complicated part of it is probably just making trpc on the client side get the data, rather than how you get it