-
Notifications
You must be signed in to change notification settings - Fork 29k
Closed
Labels
TypeScriptRelated to types with Next.js.Related to types with Next.js.good first issueEasy to fix issues, good for newcomersEasy to fix issues, good for newcomers
Milestone
Description
Describe the bug
export const getServerSideProps = async ({ params }) => {
return {
props: { foo: "bar" }
}
};
export const Page = (props: InferGetServerSidePropsType<typeof getServerSideProps>) => { ... }
causes props: never
however the following works fine:
export const getServerSideProps = async ({ params }: GetServerSidePropsContext) => {
return {
props: { foo: "bar" }
}
};
export const Page = (props: InferGetServerSidePropsType<typeof getServerSideProps>) => { ... }
as does:
export const getServerSideProps = async (ctx) => {
const params = ctx.params;
return {
props: { foo: "bar" }
}
};
export const Page = (props: InferGetServerSidePropsType<typeof getServerSideProps>) => { ... }
dferber90, thisismydesign, imtheu, varanakonda, chrsep and 21 more
Metadata
Metadata
Assignees
Labels
TypeScriptRelated to types with Next.js.Related to types with Next.js.good first issueEasy to fix issues, good for newcomersEasy to fix issues, good for newcomers