Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (infer-next-props-type) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
⛔ [DEPRECATED] The issue this package fixes is not needed anymore if you are using Next.js >= v12.3.2. More Info.
InferNextPropsType
Gets inferred typings for getStaticProps or getServerSideProps.
Install
npm install infer-next-props-type --save-devUsage
getStaticProps
import type InferNextPropsType from 'infer-next-props-type'
export function getStaticProps() {
return {
props: { foo: 'bar' }
}
}
export default function Page(props: InferNextPropsType<typeof getStaticProps>) {
return ...
}getServerSideProps
import type InferNextPropsType from 'infer-next-props-type'
export function getServerSideProps() {
return {
props: { foo: 'bar' }
}
}
export default function Page(props: InferNextPropsType<typeof getServerSideProps>) {
return ...
}