Code Editor

MyComponentClass is now a working component class! It's ready to follow its instructions object and make some React components.

So, let's make a React component! It only takes one more line:

<MyComponentClass />

To make a React component, you write a JSX element. Instead of naming your JSX element something like h1 or div like you've done before, give it the same name as a component class. VoilĂ , there's your component instance!

JSX elements can be either HTML-like, or component instances. JSX uses capitalization to distinguish between the two! That is why component class names must begin with capital letters. In a JSX element, that capitalized first letter says, "I will be a component instance and not an HTML tag."

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