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
Uh oh!
There was an error while loading. Please reload this page.
-
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
DataTypewhich is fine. The only issue is that when you would forget to passfavoriteColorin thegetServerSideProps, typescript will not throw an error that this property is missing.If we would declare the
getServerSidePropsas following (without the next-firebase-auth, just as an example):We would get a typescript error that
favoriteColoris 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