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

Wooo! Your first React component!

Take a look at the code on line 1:

var React = require('react');

require('react') returns a JavaScript object. This object contains methods that you need in order to use React.

This returned object is called the React library.

You've already seen one of the methods in the React library: React.createElement. Recall that when a JSX element is compiled, it transforms into a React.createElement() call.

For this reason, you have to require the React library and save it in a variable named React, before you can use any JSX at all. React.createElement must be available in order for JSX to work.

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