Does the next.js have types for getServerSideProps context

Solution:
have had much more luck not declaring a type on the function itself, and instead just typing the context as GetServerSidePropsContext
Jump to solution
5 Replies
JEM
JEM15mo ago
Functions: getServerSideProps
API reference for getServerSideProps. Learn how to fetch data on each request with Next.js.
JEM
JEM15mo ago
Yup You can toggle the code example to typescript
cje
cje15mo ago
i hate the types in the Next.js docs
Solution
cje
cje15mo ago
have had much more luck not declaring a type on the function itself, and instead just typing the context as GetServerSidePropsContext
JEM
JEM15mo ago
Nice yeah I like that too
Want results from more Discord servers?
Add your server