Skip to content

Commit

Permalink
it is props: { posts } (#23004)
Browse files Browse the repository at this point in the history
changing `props: posts` to `props: { posts }`
  • Loading branch information
KennethKinLum authored Mar 12, 2021
1 parent e7a22af commit 2af5a0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/basic-features/data-fetching.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export async function getStaticProps() {
const res = await fetch('https://.../posts')
const posts = await res.json()

// By returning { props: posts }, the Blog component
// By returning { props: { posts } }, the Blog component
// will receive `posts` as a prop at build time
return {
props: {
Expand Down Expand Up @@ -325,7 +325,7 @@ export async function getStaticProps() {
content: fileContents,
}
})
// By returning { props: posts }, the Blog component
// By returning { props: { posts } }, the Blog component
// will receive `posts` as a prop at build time
return {
props: {
Expand Down

0 comments on commit 2af5a0e

Please sign in to comment.