Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Getting familiar with JSX | React in Practice
Introduction to React
course content

Conteúdo do Curso

Introduction to React

Introduction to React

1. Getting Started: ES6
2. Getting Started: JSX
3. React in Practice
4. React Components
5. Controlling Data & Content
6. Hooks
7. React Router

bookGetting familiar with JSX

If you recall from the JSX chapters, we can store HTML elements inside JavaScript variables. Let's try storing a simple heading element inside a variable with an embedded name value:

After adding these two lines in the script, we will be able to render the element heading by passing it into the render method of the root instead of the older value:root.render(element);

If you look in the output console, you should be able to see rendered results.

html

index

css

index

js

index

copy

This task isn't obligatory to complete the course!

Task

On Line 26, create an unordered list having three list items Item 1, Item 2, and Item 3. Store it in a variable called myList. Render it using the root's render function.

Note

You can use the codesandbox window below. Sliding from the right edge will reveal the result (rendered page).

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 1
We're sorry to hear that something went wrong. What happened?
some-alt