Skip to content
Discussion options

You must be logged in to vote

the type returned to the page is now User | undefined

Are you sure? I just tested this locally and it works perfectly. redirect returns never, which narrows the type. You don't need the second data.session?.user, you can just do data.session.user, but even if you do leave in the optional chaining TypeScript is smart enough to know that the load function always returns user: User

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@HalfdanJ
Comment options

Answer selected by HalfdanJ
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants