React Intro Course / Chapter 1 — Getting Started with React (lessons 1–7) / Lesson 1

Why React? (Difference from Direct DOM Manipulation)

Time needed: about 7 min (estimate)

☆ Read later

You can try the opening of this lesson without an account.

A like button built in plain JavaScript

Let's build this without React first.

The spec is simple: press the button and the number shown in 3 places on screen goes up.

On every click, you find the element displaying the number yourself and rewrite its textContent.

The preview below actually runs, so try clicking it a few times.

editor.html

Tab indents. To leave the editor, press Esc, then Tab.

Create a free account to keep reading

With an account you can read the rest of this lesson, take the quiz, and read every free lesson in this course. Lessons you answer correctly are recorded as complete.

Report a problem with this lesson

Log in to send a report.

Keyboard shortcuts

Keys available in a lesson
KeyAction
[ or Alt + ←Go to the previous lesson
] or Alt + →Go to the next lesson
?Open this list
EscClose this list

The keys do not work while the cursor is in a code editor or an input field.