Hi, I’ve been working on learning React JS and have gotten stuck trying to finish this project, Ive tried to fix what I can by using the built in tutorial but I think my code matches it exactly at this point and it still isnt rendering when its all said and done, I’ll provide screenshots of all my code below this post. I also wanted to ask if there was a way for me to open up the console of this project to try debugging from there, thanks in advance.
Here are scrrenshots of the code, I had to put them in an image album because this forum wont let new accounts upload multiple images:
At the bottom of the exercises/projects, there is a “Copy to Clipboard” button.
To preserve code formatting in forum posts, see: How do I format code in my posts?
In your App.js
file, you have:
// You wrote:
comments.map((comment) => {
<Card commentObject={comment} />
})
If you use curly braces for the body of an arrow function and wish to return something, then you must explicitly use the return
keyword. Alternatively, you can omit the curly braces and do an implicit return.
// Do an explicit return since you are
// using curly braces for body of function
comments.map((comment) => {
return <Card commentObject={comment} />
})
// OR
// Do an implicit return by omitting curly braces for body of function
comments.map((comment) => <Card commentObject={comment} /> )
thank you very much, if you dont mind could you tell me how to open the console in this built in code editor so that I can try debugging things for myself next time, if not then thanks again for your help.
I don’t think there is a console in the editor.