I am stuck on Advanced JSX - Variable Attributes in JSX


Advanced JSX - Variable Attributes in JSX

I'm really not too sure what I am doing wrong here. I can click the give me the code option but I don't really want to do that as it won't help me understand why my code is not working. Please advise me where I am going wrong :slight_smile:

ERROR - After your variable declarations, make sure you start a new line with ReactDOM.render().

var React = require('react');
var ReactDOM = require('react-dom');

var goose = 'https://s3.amazonaws.com/codecademy-content/courses/React/react_photo-goose.jpg';

// Declare new variable here:
var gooseImg = ( <img src={goose} /> );

ReactDom.render(gooseImg, document.getElementById('app'));


I pretty positive that my code is correct and that it does start on a new line so no idea why I am getting this error.


Your code is right, just remember that the variable is ReactDOM, not ReactDom.
Just a simple typo, happens to the best of us :slight_smile:

If this answers your question, please be so kind as to mark this answer as the solution to your question. Thanks :slight_smile:


Ah that's so dumb, that error message was giving me the impression that I may have forgotten something that made the code start on a new line. such a silly mistake, thanks for your help though.


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