How to resolve the return type of getServerSideProps? #700
Unanswered
MathiasPawshake
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I looked into the example page: https://github.com/gladly-team/next-firebase-auth/blob/main/example/pages/ssr-no-token.tsx
There you will see that the export default is the following:
The props of the page will be
DataType
which is fine. The only issue is that when you would forget to passfavoriteColor
in thegetServerSideProps
, typescript will not throw an error that this property is missing.If we would declare the
getServerSideProps
as following (without the next-firebase-auth, just as an example):We would get a typescript error that
favoriteColor
is missing.Is there a way to achieve this with the current typescript setup in next-firebase-auth?
Beta Was this translation helpful? Give feedback.
All reactions