Map in JSX, 13/16


#1

This is my code:

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

var people = ['Rowe', 'Prevost', 'Gare'];

var peopleLIs = people.map(function(person){
  // return statement goes here:
	return <li>{person}</li>;
});

// ReactDOM.render goes here:
ReactDOM.render = (<ul>{peopleLIs}</ul>, document.getElementById('app'))

Im getting this error
After your variable declarations, make sure you start a new line with ReactDOM.render().


#2

Please post a link to this exercise. Thank you.


#3

I found the problem and cant remember what exercises it was.

But
ReactDOM.render = (<ul>{peopleLIs}</ul>, document.getElementById('app'))
Was wrong, it should be
ReactDOM.render(<ul>{peopleLIs}</ul>, document.getElementById('app'))


#4

I knew you would spot it on a closer look. We lose focus when looking at something too long. Taking a break and returning later gives us a fresh set of eyes. Good that you spotted your error!


#5

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