diff --git a/docs/basic-features/data-fetching.md b/docs/basic-features/data-fetching.md index 3dc2d1585c4db07..6185e2b2c80caf0 100644 --- a/docs/basic-features/data-fetching.md +++ b/docs/basic-features/data-fetching.md @@ -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.