Unverified Commit 3063d3b8 authored by Alex Safian's avatar Alex Safian Committed by GitHub

Update pages.md (#23064)

The `path` variable must be an array of objects which has a `params` key. This code will prevent reader confusion.
parent 9afcdfcb
...@@ -160,7 +160,9 @@ export async function getStaticPaths() { ...@@ -160,7 +160,9 @@ export async function getStaticPaths() {
const posts = await res.json() const posts = await res.json()
// Get the paths we want to pre-render based on posts // 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. // We'll pre-render only these paths at build time.
// { fallback: false } means other routes should 404. // { fallback: false } means other routes should 404.
......
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