Skip to content

Conversation

adamjmcgrath
Copy link
Contributor

Description

So you can specify the props and type for GetServerSideProps

const getPropsExample: GetServerSideProps<{ roles: string[] }, { userId: string }> = async (ctx) => {
  console.log(res.query.userId);
  return { props: { roles: ['foo'] } };
};

References

fixes #675

@adamjmcgrath adamjmcgrath added the review:tiny Tiny review label Jun 16, 2022
@adamjmcgrath adamjmcgrath requested a review from a team as a code owner June 16, 2022 10:30
@vercel
Copy link

vercel bot commented Jun 16, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
nextjs-auth0 ⬜️ Ignored (Inspect) Jun 16, 2022 at 10:30AM (UTC)

@Widcket Widcket merged commit b002ce0 into main Jun 16, 2022
@Widcket Widcket deleted the get_serverside_props_wrapper_types branch June 16, 2022 12:52
@adamjmcgrath adamjmcgrath mentioned this pull request Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review:tiny Tiny review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetServerSidePropsWrapper type issues with Props and Query
2 participants