Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update gSSP type to support props as a promise (#28999)
In a previous PR, `getServerSideProps` was altered to support returning `props` as a promise. This change updates the TS types to permit promises as well, so you can write type `GetServerSideProps<Props>` instead of `GetServerSideProps<Promise<Props>>`. e.g.: ```typescript type Props = { data: string } export const getServerSideProps: GetServerSideProps<Props> = async ( context ) => { return { props: (async function () { return { data: 'some data' } })(), } } ``` ## Feature - [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md`
- Loading branch information