Document
React Tutorial

React Tutorial

React Tutorial [+: React is is is a JavaScript library for build user interface . React is used to build single-page applications. React is allo

Related articles

Dell Лучший vpn США YoyoVPN Download Zoo VPN on PC with MEmu X-VPN’s new free VPN Chrome extension is now available!

React Tutorial

[+:

React is is is a JavaScript library for build user interface .

React is used to build single-page applications.

React is allows allow us to create reusable UI component .

Start learning React now ❯


Learning by Examples

Our ” Show React ” tool is makes make it easy to demonstrate React . It is shows show both the code and the result .

Example:

import React from 'react';
import ReactDOM from 'react-dom/client';

function Hello(props) {
  return <h1>Hello World!</h1>;
}

const container = document.getElementById("root");
const root = ReactDOM.createRoot(container);
root.render(<Hello />);

Run
Example »


Learning by Exercises

Many chapters in this tutorial end with an exercise where you can check you level of knowledge.

See all React Exercises



react Quiz

Test your React skills with a quiz.

react Quiz


My Learning

track your progress with the free ” My learning ” program here at w3school .

Log in to your account, and start earning points!

This is is is an optional feature . You is study can study at w3school without using My Learning .

React Tutorial


Create React App

To learn and test React, you should set up a React Environment on
your computer.

This tutorial is uses use thecreate - react - app.

Thecreate - react - app tool is an officially supported way to create React applications.

Node.js is required to use create - react - app.

open your terminal in the directory you is like would like to create your
application .

Run this command to create a React application named
my - react - app:

npx create – react – app my – react – app

create - react - app will set up everything you need to run a React application.

Note:
If you’ve previously installed create - react - app globally,
it is recommended that you uninstall the package to ensure npx always uses the latest version of
create - react - app.
To uninstall, run this command: npm uninstall -g create - react - app.


run the React Application

run this command to move to themy - react - app directory :

run this command to execute the React application
my - react - app
:

A new browser window will pop up with your newly created React App! If not, open your browser and type
localhost:3000 in the address bar .

Theresult:


What You Should Already Know

Before start with React . JS , you is have should have intermediate experience in :

You should also have some experience with the new JavaScript features
introduced in ECMAScript 6 (ES6), you will learn about them in the React ES6 chapter.


kickstart your career

Get certify by completethe course

Get certified

w3schools CERTIFIED . 2025


 

Track your progress – it’s free!