Tell us what’s happening:
Hi can someone point out to me where I am going wrong with this challenge for addingcomments in JSX after several attempts I still can’t figure out where I am going wrong.
**Your code so far**
const JSX = (
<div>
{/*
<h1>This is a block of JSX</h1>
<p>Here's a subtitle</p>
*/}
</div>
);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0.
You’ve commented out the h1 and p - don’t do that. Don’t comment anything out, just add a text comment in there - but the JSX should output the same thing it did before.
to add a comment within a JSX code, you practically need to add a JavaScript code which represents comment. To put a JavaScript code within JSX, you wrap it inside curly braces { your code } . For JS comments you use /* your comment */ . So in conclusion, you use {} inside which you put your comment- {/*comment inside JSX*/}
In your code you have wrapped your h1 and p tags within the JS comment body, which contradicts with the challenge requirements. You shouldnt comment out parts of the html/JSX
That’s 100% cool, we’ve all been there. That’s why this forum exists. Just let us know if you need more clarification. My point was just to make your questions specific.