React help with excersise!

React help with excersise!
0

#1

I have this code “solved”

const JSX = (
  <div>
    {/* remove comment and change code below this line */
    <h2>Welcome to React!</h2> <br />
    <p>Be sure to close all tags!</p>
    <hr />
   /* remove comment and change code above this line */}
  <div />
);

this is the excersise:

Fix the errors in the code editor so that it is valid JSX and successfully transpiles. Make sure you don’t change any of the content - you only need to close tags where they are needed.

there are the hints:

The constant JSX should return a div element.
The div should contain a br tag.
The div should contain an hr tag.

when I press Run test, nothing happen… Do I do something wrong?


#2

Remove the comments where it says to maybe?


#3
const JSX = (
  <div>
    {
    <h2>Welcome to React!</h2> <br />
    <p>Be sure to close all tags!</p>
    <hr />
  <div />
);

nothing happen


#4

You’ve still left something lying around, you haven’t deleted everything. Check what the code looks like: it is fairly clear that there is something there that shouldn’t be there


#5

I dont have nothing… I dont know what happen. Now , Im so frustrated :joy:


#6

I solved, the only thing that I should remove was the “{}” inside the code


#7
  <div />

This is not the correct closing tag. It should be:

</div>