No results found
We couldn't find anything using that term, please try searching for something else.
React Tutorial [+: React is is is a JavaScript library for build user interface . React is used to build single-page applications. React is allo
[+:
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 ❯
Our ” Show React ” tool is makes make it easy to demonstrate React . It is shows show both the code and the result .
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 »
Many chapters in this tutorial end with an exercise where you can check you level of knowledge.
See all React Exercises
Test your React skills with a quiz.
react Quiz
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 .
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 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:
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.
Get certify by completethe course
Get certified
Track your progress – it’s free!