Create a User Interface with React’s createElement API

Share this video with your friends

Send Tweet

React uses the same APIs to control and update the DOM that we did in the previous lesson. But it offers so much to the table that we’re going to introduce it into the project and rewrite what we’ve written to React code. Instead of creating DOM elements, we’ll create React elements and then hand those off to react-dom to handle turning those into DOM elements and putting them into the page.

If you’ve ever learned or used React before, you’re probably more familiar with JSX than React’s createElement API, but it’s important to understand the createElement API first so you understand the magic and can become a code magician yourself. Not to worry, we’ll get to JSX soon enough!

Rafael Martins
Rafael Martins
~ 4 years ago

Not sure if I'm 100% correct, but I tried to use the transcript imports and it didn't work, mainly because we request "react-dom@16.12.0/umd/react.development.js" instead of " react-dom@16.12.0/umd/react-dom.development.js"

I would say their library name pattern got changed, I might suggest changing the transcript accordingly.

Lucas Minter
Lucas Minter
~ 4 years ago

Thanks for this Rafael! I got the transcripts updated to the correct imports.

Jon
Jon
~ 2 years ago

The transcript imports referenced above didn't work for me either, b/c the https scheme is missing an extra / (had to get the 'ol diff checker out to spot this one) 😎

Lucas Minter
Lucas Minter
~ 2 years ago

Sorry about that Jon! I've got that updated and it should be correct now.