From b0925c3ef59aac309e154a98786de593391f90ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Mon, 9 Mar 2020 09:59:33 +0100 Subject: [PATCH 1/2] Fix getStaticPaths example code --- docs/basic-features/data-fetching.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/basic-features/data-fetching.md b/docs/basic-features/data-fetching.md index 3dc2d1585c4db07..a1143cd5f9effe9 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: `/posts/${post.id}`} + })) // We'll pre-render only these paths at build time. // { fallback: false } means other routes should 404. From bd91281e6121bce3063fdfec01bbf742cd1d4b58 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 9 Mar 2020 10:23:06 +0100 Subject: [PATCH 2/2] Update docs/basic-features/data-fetching.md --- docs/basic-features/data-fetching.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basic-features/data-fetching.md b/docs/basic-features/data-fetching.md index a1143cd5f9effe9..6185e2b2c80caf0 100644 --- a/docs/basic-features/data-fetching.md +++ b/docs/basic-features/data-fetching.md @@ -192,7 +192,7 @@ export async function getStaticPaths() { // Get the paths we want to pre-render based on posts const paths = posts.map(post => ({ - params: {id: `/posts/${post.id}`} + params: {id: post.id} })) // We'll pre-render only these paths at build time.