React - Add Comments in JSX

Tell us what’s happening:

comment line not working i tried everything but not worked.

Your code so far

const JSX = (
    <h1>This is a block of JSX</h1>
    <p>Here's a subtitle</p>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge Information:

React - Add Comments in JSX

Hi there and welcome to our community!

It looks like you haven’t modified the seed code for this challenge. Can you show what you’ve tried please?

As per the challenge instructions, the syntax for a comment in JSX is:
{/* this is a comment */}

You should be adding a comment (such as the one above) inside your div element, without modifying any of the other code.

1 Like