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
JEM2y ago
Functions: getServerSideProps
API reference for getServerSideProps. Learn how to fetch data on each request with Next.js.
JEM
JEM2y ago
Yup You can toggle the code example to typescript
cje
cje2y ago
i hate the types in the Next.js docs
Solution
cje
cje2y ago
have had much more luck not declaring a type on the function itself, and instead just typing the context as GetServerSidePropsContext
JEM
JEM2y ago
Nice yeah I like that too

Did you find this page helpful?