Create HTML elements with React's createElement API

InstructorKent C. Dodds

Share this video with your friends

Send Tweet

In this lesson we'll learn how to use raw React APIs to create the most basic Hello World example. React defines it’s own createElement function that we will see works similar to document.createElement. And in place of appendChild we will use ReactDOM's render function.

We'll also learn a little bit about React props and the children prop.

Juan
~ 7 years ago

I'm completely lost. what text editor are you using?

Kent C. Doddsinstructor
~ 7 years ago

Hi Juan, Sorry you're lost. The text editor on the left is Atom and the part on the right is Chrome. Maybe this will help...

Louis Varney
~ 6 years ago

It seems like there is some info missing from this. Like where to start? Are you supposed to use Create App? Are you doing this in CodeSandbox and just deleting all your code?

Kent C. Doddsinstructor
~ 6 years ago

Hey Louis, as mentioned in the introduction video and course description, the left side of the screen is just an index.html file and the right side is a regular browser with that file opened.

Louis Varney
~ 6 years ago

Thanks Kent, I must have missed that bit. I even double checked!!

4mation Technologies
~ 5 years ago
Tony Ngo
~ 5 years ago

This seems to be a good course but I don't know where to start. Is there a good course to setup a React project?

reactor.wlb
~ 5 years ago

This seems to be a good course but I don't know where to start. Is there a good course to setup a React project?

I think to setup a React Project for learning purpose based on this course, just explore the "Code in editor" which instructor provide.

Ankit
~ 5 years ago

Is this course still relevant for a beginner?

Keith Price
~ 5 years ago

What is the advantage of this HTML method vs the javascript app method? It seems the app method is much simpler. Compare this Hello World code to what you've got in the html file:

import React from 'react'; import './App.css';

function App() { return ( <div className="App"> <header className="App-header"> Hello World </header> </div> ); }

export default App;