Intro to JSX 8/15 mis-keyed


#1

https://www.codecademy.com/en/courses/react-101/lessons/react-jsx-intro/exercises/nested-jsx

Exercise 8/15, “Nested JSX” provides the following instructions:

Declare a new variable named myDiv. Set myDiv equal to a JSX <div></div> element. Wrap the <div></div> in parentheses, and use indentation and line breaks like in the examples. In between the <div></div> tags, nest an <h1></h1> containing the text Hello world.

I’ve written the following code to answer this:

var myDiv = (
        <div>
            <h1>Hello world</h1>
        </div>
);

Even though I’ve re-written this, re-loaded the page, logged out and back in, I keep getting the error message,

"Did you nest an <h1></h1> inside of your <div></div>?"

Unfortunately, without resolving this problem, I can’t advance in the tutorial (the next btn is disabled, and the next lesson is locked in the menu).

Any idea on how to move past this?


#2

OK, it seems to be working now. Not sure what’s different.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.