This tutorial will show you how to use React and build your first web application using it.
Before we begin, you must know what JSX is, as React uses it to function properly.
var element =
The quick brown fox jumps over the lazy dog;
Because this tutorial is for beginners, we are going to start simple. We are only going to use two files:
index.js(or whatever you want it to be named)
First, we are going to set up the HTML file. All we need to do is create a basic webpage, create a
element, and load the React library. We are going to use a CDN, so we don’t have to download the full library.
The versions above are meant for development, and not for production. Minified and optimized production versions of React are also available:
For this tutorial, we are going to use the development version.
The HTML file should look like this:
My First React App https://unpkg.com/react@17/umd/react.development.js https://unpkg.com/react-dom@17/umd/react-dom.development.js http://index.js
Hello, world!, document.getElementById('root') );
Here is the same example, but without JSX:
ReactDOM.render( React.createElement('h1', null, 'Hello, world!'), document.getElementById('root') );
Your website should look like this:
Congratulations! You have just learned to create your very first web app using React! I hope you enjoyed this tutorial!