Master React From Scratch

Clear, practical, and structured React lessons designed for beginners and developers.

COURSE SYLLABUS
1. Introduction to React
Introduction to React What Is React? Features of React Advantages of React Limitations of React Uses of React React vs JavaScript React Architecture
2. React Getting Started
Getting Started Introduction Prerequisites Installing Node.js and npm Creating a React Project with Vite React Project Structure Running React Application Your First React Application
3. JSX
JSX Introduction What Is JSX? JavaScript Expressions JSX Attributes Rendering JSX Elements JSX Children React Fragments JSX Rules and Best Practices JSX vs HTML
4. React Components
Components Introduction Functional Components Class Components Component Composition Reusable Components Component Tree Component Lifecycle Import and Export Components
5. React Props
Props Introduction What Are Props? Passing Props to Components Props Destructuring Default Props Values Children Props Typing Props with TypeScript Props vs State
6. React State
State Introduction What Is State? useState Hook Updating State Functional State Updates State with Objects State with Arrays State Immutability Lifting State Up
7. React Events
Events Introduction Handling Events Passing Arguments to Event Handlers Synthetic Events Form Events Keyboard and Mouse Events Event Propagation
8. Conditional Rendering
Conditional Rendering Introduction If-Else Rendering Ternary Operator Logical AND Operator Element Variables Preventing Rendering Multiple Conditions Conditional CSS Classes
9. Lists and Keys
Lists and Keys Introduction Rendering Lists with map() Understanding Keys Choosing Unique Keys Lists of Objects Filtering Lists Sorting Lists Empty Lists and Conditional Rendering
10. React Forms
Forms Introduction Handling Forms Controlled Components Uncontrolled Components Handling Input Fields Checkboxes and Radio Buttons Select and Textarea Form Validation Form Submission
11. React Hooks
Hooks Introduction useState Hook useEffect Hook Effect Dependencies and Cleanup useRef Hook useReducer Hook useMemo Hook useCallback Hook Custom Hooks Rules of Hooks
12. React Context API
Context API Introduction createContext useContext Context Provider Reading Context Updating Context Using Multiple Contexts Context API vs Props Context API Best Practices
13. React Routing
Routing Introduction Introduction to React Router Installing React Router BrowserRouter Setup Routes and Route Components Link and NavLink Programmatic Navigation URL Parameters and useParams Nested Routes Not Found Routes Protected Routes
14. API Integration
API Integration Introduction Fetch API Async/Await with API Calls Displaying API Data Loading and Error States Sending POST Requests API Error Handling Using Axios Custom Fetch Hook API Environment Variables
15. State Management
State Management Introduction Global State Prop Drilling Introduction to Redux Redux Core Concepts Redux Toolkit Store and Slices useSelector and useDispatch Async Operations with Redux Toolkit State Management Best Practices
16. React Performance
Performance Introduction Understanding Re-Renders Avoiding Unnecessary Re-Renders React.memo useMemo Optimization useCallback Optimization React Developer Tools and Profiler Lazy Loading Components Code Splitting Optimizing Large Lists Performance Best Practices

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.

Important: You do not need to be an expert in JavaScript before starting React. However, understanding the fundamentals will make components, props, state, and events much easier to learn.

2. React Prerequisites Diagram

Understand the four main categories of preparation before starting a React project.

Your Goal

Start React Development

Create and run your first React app.

↓
JS

Basic Knowledge

HTML, CSS and JavaScript

N

Development Tools

Node.js and npm

</>

Code Editor

Visual Studio Code or another editor

WEB

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

HTML defines the structure and content of a web page.

<h1>Hello</h1>

Example: A heading on the page.

CSS

CSS

CSS controls the appearance, layout, spacing, and colors of the page.

color: blue;

Example: Setting text color.

JS

JavaScript

JavaScript adds behavior, event handling, and dynamic operations.

console.log("Hello");

Example: Printing a message.

Learning tip: Before starting React, practice variables, functions, arrays, objects, arrow functions, array methods, and JavaScript modules such as 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

Terminal Node.js
node --version

This command displays the installed Node.js version.

Command 2: Check npm

Terminal 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.

Remember: If both commands display version numbers, the terminal can find these tools. The versions must also meet the requirements of the project tools you plan to use.

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.

1

Install a Code Editor

Install Visual Studio Code or choose another editor suitable for JavaScript development.

2

Open Your Project Folder

Once the Vite project is created, open its root folder in the editor.

3

Understand the Important Files

You will work with files such as src/App.jsx, src/main.jsx, and package.json.

4

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.
Debugging tip: Read the complete error message before changing files or reinstalling tools. The message often identifies the specific problem.

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.