React Prerequisites
Learn the basic knowledge, software, and development tools required before creating your first React application.
1. What Are React Prerequisites?
Prerequisites are the basic concepts and tools you should know or prepare before starting a technology. Before learning React, it is helpful to understand HTML, CSS, and JavaScript.
You also need Node.js, npm, a code editor, and a web browser to create, manage, and run a React development project.
2. React Prerequisites Diagram
Understand the four main categories of preparation before starting a React project.
Start React Development
Create and run your first React app.
Basic Knowledge
HTML, CSS and JavaScript
Development Tools
Node.js and npm
Code Editor
Visual Studio Code or another editor
Web Browser
Chrome, Edge, or another modern browser
Ready to Create a React Project
Move to Node.js installation and project setup.
3. Basic Web Development Knowledge
React is used to build user interfaces. The following web technologies provide the foundation for understanding how a React application works.
HTML
HTML defines the structure and content of a web page.
<h1>Hello</h1>
Example: A heading on the page.
CSS
CSS controls the appearance, layout, spacing, and colors of the page.
color: blue;
Example: Setting text color.
JavaScript
JavaScript adds behavior, event handling, and dynamic operations.
console.log("Hello");
Example: Printing a message.
import and
export.
4. Software and Tools Required
| Tool | Purpose | Required? |
|---|---|---|
| Node.js | Provides the JavaScript runtime used by development tools. | Required |
| npm | Installs and manages project packages. | Required |
| Code Editor | Used to write and edit application files. | Required |
| Web Browser | Displays and tests the React application. | Required |
| Git | Tracks code changes and supports collaboration. | Optional |
npm is normally installed together with Node.js using the official Node.js installer.
5. Check Whether Node.js and npm Are Installed
Open Command Prompt, PowerShell, or the integrated terminal in Visual Studio Code. Enter the following commands.
Command 1: Check Node.js
node --version
This command displays the installed Node.js version.
Command 2: Check npm
npm --version
This command displays the installed npm version.
Example Output
v22.x.x
10.x.x
These are illustrative version formats, not guaranteed current versions. Your output will show the versions installed on your computer.
6. Prepare Your Code Editor
A code editor helps you create and manage React source files. For the examples in this course, you can use Visual Studio Code.
Install a Code Editor
Install Visual Studio Code or choose another editor suitable for JavaScript development.
Open Your Project Folder
Once the Vite project is created, open its root folder in the editor.
Understand the Important Files
You will work with files such as
src/App.jsx, src/main.jsx,
and package.json.
Use the Integrated Terminal
Open the terminal in your editor to run npm commands inside the project folder.
7. Prepare Your Browser
A modern browser is needed to open your React application and inspect its behavior.
Open the Local Development URL
Start the development server and open the URL displayed in the terminal.
Inspect the Page
Use browser developer tools to inspect elements, view console messages, and debug errors.
Check for Errors
Look at the browser console and development terminal when something does not work as expected.
8. Common Problems and Solutions
| Problem | Possible Reason | What to Check |
|---|---|---|
node is not recognized |
Node.js may be missing or unavailable in PATH. | Install Node.js and reopen the terminal. |
npm is not recognized |
npm may not be installed correctly or PATH may be incorrect. | Check the Node.js installation and terminal environment. |
Cannot find package |
A required package may be missing. | Check the project folder and run npm install. |
| Application does not open | The development server might not be running. | Run npm run dev in the correct project folder. |
| Project creation fails | The Node.js version or network may be unsuitable. | Check tool requirements, internet access, and the terminal error. |
9. React Readiness Checklist
Use this checklist to review the basic preparation required before moving to the installation lesson.
This checklist is for self-assessment. You can continue learning while improving your JavaScript knowledge.
Summary
- HTML, CSS, and JavaScript are useful foundations for React.
- Node.js provides the runtime needed by development tools.
- npm manages packages required by a React project.
- A code editor helps you write and organize application files.
- A modern browser is used to view and test the application.
- Terminal commands help verify the environment and diagnose problems.