Alessandro Carrese Alessandro Carrese - 1 year ago 138
React JSX Question

React componentClass on codecademy, what's wrong?

I'm learning React through Codecademy and it asks :

On line 20, declare a new variable named Friend.

Set Friend equal to a component class, made with React.createClass().

Pass an object to React.createClass().

Give this object one property. Make the property's name render.

Make the property's value this function:

function () {

`return (`


my code is this:


var friends = [
title: "Yummmmmmm",
src: ""
title: "Hey Guys! Wait Up!",
src: ""
title: "Yikes",
src: ""

var Friend=React.createClass({
render: function(){
return (


I can't figure out where I'm wrong

Answer Source

ridiculous error, React and ReactDOM should have the var keyword

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