Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Update data-fetching.md (vercel#27018)
Browse files Browse the repository at this point in the history
Improve typing for use with Typescript example

<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order to make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change that you're making:

## Feature

- [ ] 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`
- [ ] Integration tests added
- [X] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [X] Make sure the linting passes
  • Loading branch information
papaponmx committed Jul 8, 2021
1 parent 06336eb commit b09335a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/basic-features/data-fetching.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,11 @@ You should use `getStaticProps` if:
For TypeScript, you can use the `GetStaticProps` type from `next`:

```ts
import { GetStaticProps } from 'next'
import { GetStaticProps, GetStaticPropsContext } from 'next'

export const getStaticProps: GetStaticProps = async (context) => {
export const getStaticProps: GetStaticProps = async (
context: GetStaticPropsContext
) => {
// ...
}
```
Expand Down

0 comments on commit b09335a

Please sign in to comment.