Installing the React framework
To install the framework, you will need
NodeJS 22+
on your computer.
To create a project in the command line, run
the following command:
npm create vite@latest my-app -- --template react
Then run the following commands:
cd my-app
npm install
npm run dev
After that, you will have a folder my-app
, which contains the framework. Find the folder src
in this folder - this will be your working folder, in which you will develop your project.
In the src
folder, find the App.js
file. This file will be your main working file for the next few lessons. You will write code in it and see the results in the browser window.
Open this file in an editor and remove all unnecessary parts from it, bringing it to this form:
import React from 'react';
function App() {
return <div>
text
</div>;
}
export default App;
Once your project is installed, for the next launch (for example, after rebooting your computer), you just need to go to the my-app
folder via the terminal and run the following command:
npm run dev