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. ...@@ -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`: Make sure to return the following shape from `getStaticProps`:
```js ```ts
export async function getStaticProps(ctx: { export async function getStaticProps(ctx: {
params?: ParsedUrlQuery params?: ParsedUrlQuery;
preview?: boolean preview?: boolean;
previewData?: PreviewData previewData?: PreviewData;
}) { }) {
return { return {
props: { [key: string]: any } 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