getServersideProps not providing type inference, and session getting lost between server and client
I have this function (which I've used many times before),
for some reason, however, type inference with the page is not working, typed as follows
and on top of this, the session prop is getting lost, so when i log props on the client, the return is just an empty object. strangely enough it does work for auth purposes, redirecting unauthed users.
i would just simply use useSession, however i have to conditionally render all of the data from this hook since its possible undefined or null, whereas if i got my session from getServerSideProps, I could ensure that its not null and avoid the conditional logic in my ui.
i'm quite lost on this, and any help would be appreciated.
3 Replies