13/15 Variable inside ReactDOM.render()


#1


Hi everyone, I was wondering if anyone can provide some input on a situation I'm facing. I've ensured that the first argument inside the ReactDOM.render(); is correct, and have at least checked it 3 times. Unless I'm missing extremely obvious, would one be able to see what's wrong with my code? Or, would one see this as a bug?

Appreciate any feedback on this.

Kind regards,
Ehsan


Exercise:

https://www.codecademy.com/courses/react-101/lessons/react-jsx-intro/exercises/reactdom-render-variable?action=resume

Error message: The first argument passed to ReactDOM.render should be myList.
Behaviour: The console does not seem to accept my code despite using the guide code inside the explanation tab, as reference.


Code inside app.js :

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

// Write code here:
var myList = (
    <ul>
        <li>Learn JS</li>
        <li>Learn ReactJS</li>
        <li>Learn Node</li>
    </ul>
);

ReactDOM.render(
  mylist, 
  document.getElementById('app')
);

Code inside index.html:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<link rel="stylesheet" href="/styles.css">
	<title>Learn ReactJS</title>
</head>

<body>
  <main id="app"></main>
	<script src="https://s3.amazonaws.com/codecademy-content/courses/React/react-course-bundle.min.js"></script>
  <script src="/app.compiled.js"></script>
</body>

</html>


#2

Hi guys, I just found out I didn't put the L in myList, capitalized - all working now.


#3

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