abadfish / react-create-element-lab-g-416

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React createElement() Lab

Overview

In this lab, you'll build a simple view using createElement().

Representing

Internet.

Before we start, don't forget to add the React and ReactDOM libraries to your index.html:

<script src="node_modules/react/dist/react.js"></script>
<script src="node_modules/react-dom/dist/react-dom.js"></script>

This should be after any page content, and before your own index.js script.

Your task is to create a React element that represents you (or a close approximation, hopefully)! In the index.js file create a variable called meInReact. This variable should be a React element, and should have the following structure:

<div class="me">
  <h1>An Awesome Person</h1>
  <p>Who is learning React</p>
  
  <ul class="me__interests">
    <li>JavaScript</li>
    <li>React</li>
    <li>Movies</li>
    <li>Ice cream</li>
  </ul>
</div>

Feel free to render out the component in the DOM using ReactDOM.render().

Resources

About

License:Other


Languages

Language:JavaScript 71.8%Language:HTML 20.2%Language:Shell 8.0%