Closed DPigeon closed 5 years ago
[11/15, 3:36 PM] Anas: Looks like you are indexing at the wrong place @David [11/15, 3:37 PM] Anas: Your data is an array of object, and each object has a key "message list" which is an array right? [11/15, 3:39 PM] Anas: So the indexing should be on post (post[i]) [11/15, 3:39 PM] Anas: And the for every post you get the comment list and use the map function to render like you're doing
I think I tried that too by doing this.state.posts[i].commentList. I was only able to get all the comments only on post 1 though
I fixed this.
Anyone can resolve this ?
I am trying to display an array of an array (posts being in comments) on React's Javascript. Yes, I am using the right method with .map(). I am passing the entire posts array to this.props.posts and I am trying to get all the comment lists to show with it. I just don't get why after I run the website that this error occurs:
Thanks