Skip to content

Commit

Permalink
Fix getStaticPaths example code (#10893)
Browse files Browse the repository at this point in the history
* Fix getStaticPaths example code

* Update docs/basic-features/data-fetching.md

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
  • Loading branch information
balazsorban44 and timneutkens committed Mar 9, 2020
1 parent 2abbb7a commit 213a4b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/basic-features/data-fetching.md
Expand Up @@ -191,7 +191,9 @@ export async function getStaticPaths() {
const posts = await res.json()

// Get the paths we want to pre-render based on posts
const paths = posts.map(post => `/posts/${post.id}`)
const paths = posts.map(post => ({
params: {id: post.id}
}))

// We'll pre-render only these paths at build time.
// { fallback: false } means other routes should 404.
Expand Down

0 comments on commit 213a4b8

Please sign in to comment.