Skip to content

Commit

Permalink
Update get-static-props.md (#38703)
Browse files Browse the repository at this point in the history
Update the file name in the import statement in the "write server-side code directly" section in the documentation
  • Loading branch information
dorian-davis committed Jul 16, 2022
1 parent 4a774a4 commit 7280c3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/basic-features/data-fetching/get-static-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ This means that instead of fetching an **API route** from `getStaticProps` (that
Take the following example. An API route is used to fetch some data from a CMS. That API route is then called directly from `getStaticProps`. This produces an additional call, reducing performance. Instead, the logic for fetching the data from the CMS can be shared by using a `lib/` directory. Then it can be shared with `getStaticProps`.

```jsx
// lib/fetch-posts.js
// lib/load-posts.js

// The following function is shared
// with getStaticProps and API routes
Expand Down

0 comments on commit 7280c3c

Please sign in to comment.