Cool app idea! I’m just diving into the world of React as well so I don’t have a solution necessarily, but I think I’ve spotted your problem.
App.js file, you’re rendering the
Post components with map method on the
posts array. With each rendering, you’re giving the
Post a prop called
comments and assigning it to the
data.num_comments. For your app, it looks like a good idea to be handing the
Post components the
num_comments, but if you inspect the JSON that you’re fetching from, you can see that
num_comments is assigned to a integer and nothing else.
From inspecting the JSON, I can’t see find any key/value pairs that could render the comments section. However, it does have one key called
permalink that links directly to that post on reddit. Upon pressing the comments button in your app, you could possibly fetch another JSON file from that permalink that does contain a key assigned to the comments.