Click here to navigate the course.

Drag the edges to resize the window.

In Projects, you can keep track of your progress as you go throught the tasks. Check each item as you complete it!

Code Editor
Learn

Let's review what you've learned so far! Find each of these points in app.js:

  • On line 1, var React = require('react') saves a JavaScript object into your file. This object contains methods that are needed to make React work, such as React.createElement and React.createClass.

  • On line 2, var ReactDOM = require('react-dom') saves another JavaScript object into your file. This object contains methods that are concerned with DOM interaction, such as ReactDOM.render.

  • On line 4, React.createClass returns a new component class. A component class is not a component - it's more like a factory that produces components. Every component must come from a component class.

  • When you call React.createClass, you should save the returned component class in a variable. That variable's name should be written in UpperCamelCase.

Something that we haven't talked about yet is the argument that gets passed to React.createClass.

React.createClass takes one argument. That argument must be a JavaScript object. This object will act as a set of instructions, explaining to your component class how to build a React component.

Here's what your "instructions object" would look like on its own. Find it in app.js:

{ render: function () { return <h1>Hello world</h1>; } }

That doesn't look like a set of instructions explaining how to build a React component! Yet that's exactly what it is.

Click Next, and we'll go into how these instructions work.

Report a Bug
If you see a bug or any other issue with this page, please report it here.