1

I was about to copy the code in this video on youtube https://www.youtube.com/watch?v=LFRYYIoiIZg&t=930s&ab_channel=Icodestuff

But the problem is the code I copy is not working, its like totally the same my NOTION API is working But this one is not, and it has an error in browser

"posts.map is not a function"

 {posts.map((post: BlogPost) => (
     <p key={post.id}>It should have a posts here:{post.title}</p>
  ))}

I already tried

        {Object.values(posts).map((post: BlogPost) => (
          <p key={post.id}>It should have a posts here:{post.description}</p>
        ))}

It doesnt have error but the output is :

It should have a posts here:

Alvin
  • 11
  • 2
  • Did you read the error? Always read the error, don't ignore it. `posts` isn't an array, use `console.log` to debug what it is. – Andy Ray Jun 09 '23 at 04:11

0 Answers0