How to Comment JSX Code Block?

Tell us what’s happening: How to comment JSX Code?

Your code so far

const JSX = (
<div> {/* This is a comment */}
  <h1>This is a block of JSX</h1>
  <p>Here's a subtitle</p>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36.

Challenge: Add Comments in JSX

Link to the challenge:

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

The more information you give us, the more likely we are to be able to help.

What’s wrong?

I posted the whole code but yet I can only see small portion of code.

The reason that code does not pass the tests is the extra space between the opening div tag, and the comment.

1 Like