course content

Course Content

Introduction to React

JSX Variables & Nested ElementsJSX Variables & Nested Elements

The simplest application is the variables. As explained in the previous chapter, we can store HTML elements into JavaScript variables. We can also store more complicated items like lists that include nested elements.

Task

Create a variable called myList and store an unordered list inside it. The list should have four list items having inner HTML equal to Item 1, Item 2, Item 3 and Item 4 respectively.

question-icon

Fill in the gaps.

const
_ _ _
=
_ _ _

_ _ _

_ _ _

_ _ _

_ _ _

_ _ _

Click or drag`n`drop items and fill in the blanks

dots
<li>Item 1</li>
dots
myList
dots
</ul>
dots
<ul>
dots
<li>Item 4</li>
dots
<li>Item 2</li>
dots
<li>Item 3</li>
down-icon

Section 2.

Chapter 2