Unverified Commit 739e6f07 authored by Samuel's avatar Samuel Committed by GitHub

Docs: Add useful link to invalid-getstaticprops-value error message (#35915)

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

I would like to add useful link to `getStaticProps` invalid return value error message as currently there is no useful link being provided. I believe that this might improve the developer experience.
parent b1a7b888
......@@ -8,14 +8,18 @@ In one of the page's `getStaticProps` the return value had the incorrect shape.
Make sure to return the following shape from `getStaticProps`:
```js
```ts
export async function getStaticProps(ctx: {
params?: ParsedUrlQuery
preview?: boolean
previewData?: PreviewData
params?: ParsedUrlQuery;
preview?: boolean;
previewData?: PreviewData;
}) {
return {
props: { [key: string]: any }
}
return {
props: { [key: string]: any }
}
}
```
### Useful Links
- [`getStaticProps` Documentation](https://nextjs.org/docs/api-reference/data-fetching/get-static-props)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment