Lesson 7 of 60 – Installing VS Code
12%

Installing VS Code

Visual Studio Code (VS Code) is a lightweight and powerful source-code editor that can be used for React development. It provides features such as syntax highlighting, code completion, extensions, an integrated terminal, debugging support, and Git integration.

Note: VS Code is an editor, not React itself. You will use VS Code to write and manage your React project files.

1. What is VS Code?

Visual Studio Code is a source-code editor developed by Microsoft. It can be used to write JavaScript, JSX, HTML, CSS, and many other types of code.

VS Code
   ↓
Write Code
   ↓
React Project
   ↓
Web Application

2. Why Use VS Code for React?

VS Code provides several features that are useful when developing React applications.

  • JavaScript and JSX editing
  • Syntax highlighting
  • Code completion
  • Integrated terminal
  • Extensions
  • Git integration
  • Debugging support
  • Project file management

3. Download VS Code

VS Code can be downloaded from the official Visual Studio Code website.

Official VS Code Website
          ↓
      Download
          ↓
Choose Operating System
          ↓
       Install

Choose the installer appropriate for your operating system.

4. Supported Operating Systems

VS Code is available for major desktop operating systems.

  • Windows
  • macOS
  • Linux

Download the appropriate version for your computer.

5. Installing VS Code on Windows

On Windows, download the VS Code installer and run the downloaded setup file.

Download Installer
       ↓
Run Setup
       ↓
Accept License
       ↓
Choose Options
       ↓
Install
       ↓
Launch VS Code

6. Installing VS Code on macOS

On macOS, download the appropriate VS Code package and install the application according to the platform's normal installation process.

Download
   ↓
Install VS Code
   ↓
Open VS Code
   ↓
Create / Open Project

7. Installing VS Code on Linux

VS Code can also be installed on Linux using a suitable package or installation method for the selected distribution.

Linux
  ↓
Install VS Code
  ↓
Open Editor
  ↓
Open React Project

8. Start VS Code

After installation, open Visual Studio Code from your operating system's application menu or shortcut.

VS Code
   ↓
Welcome Screen
   ↓
Open Folder
   ↓
Project

9. VS Code Interface

The VS Code interface contains several important areas.

+--------------------------------------+
| Menu / Toolbar                       |
+------+-------------------------------+
|      |                               |
| Side |        Editor                 |
| Bar  |                               |
|      |                               |
+------+-------------------------------+
|        Integrated Terminal           |
+--------------------------------------+

10. Explorer Panel

The Explorer panel allows you to view and manage files and folders inside your project.

my-react-app/
 |
 +-- src/
 +-- public/
 +-- package.json

You can open files directly from the Explorer.

11. Editor Area

The editor area is where you write and edit your source code.

function App() {

    return (
        <h1>Hello React</h1>
    );

}

You can open multiple files using editor tabs.

12. Integrated Terminal

VS Code includes an integrated terminal, allowing you to run commands without opening a separate terminal application.

npm --version
node --version
npm run dev

This is especially useful for React development.

13. Open the Terminal

You can open the integrated terminal from the VS Code interface. You can also use the terminal shortcut supported by your operating system and VS Code configuration.

VS Code
   ↓
Terminal
   ↓
Command Prompt / PowerShell / Shell
   ↓
Run Commands

14. Open a React Project

Use the VS Code file or folder opening option to open your React project.

VS Code
   ↓
Open Folder
   ↓
my-react-app/
   ↓
Project Files

Opening the project folder allows VS Code to display the complete project structure.

15. Creating a New File

You can create new files from the Explorer panel. For example:

src/
 |
 +-- App.jsx
 +-- main.jsx
 +-- components/
       |
       +-- Header.jsx

The exact file names depend on the project structure you use.

16. JavaScript Support

VS Code provides built-in editing support for JavaScript.

const name = "Amit";

function greet() {
    return `Hello ${name}`;
}

Features such as syntax highlighting and code completion can make JavaScript development easier.

17. JSX Support

React applications commonly use JSX. VS Code can provide syntax highlighting and editing support for JSX files.

function App() {
    return (
        <div>
            <h1>Hello React</h1>
        </div>
    );
}

18. Code Completion

VS Code can provide suggestions while you type code.

console.
document.
Array.
React.

Code completion can help developers discover available properties, methods, and symbols.

19. Syntax Highlighting

VS Code uses syntax highlighting to make different parts of source code easier to distinguish.

const name = "React";

function App() {
    return <h1>{name}</h1>;
}

Different language elements are visually distinguished by the editor.

20. Extensions

VS Code supports extensions that can add functionality to the editor.

  • Language support
  • Formatting tools
  • Linting tools
  • Git tools
  • Debugging tools
  • Productivity features

Install extensions only when they are useful for your project.

21. Recommended React Development Extensions

Depending on your project, you may use extensions that improve JavaScript, JSX, formatting, or code quality workflows.

VS Code
   ↓
Extensions
   ↓
JavaScript / JSX Tools
   ↓
Better Development Experience

The exact extension choices can vary between projects and teams.

22. Formatting React Code

Code formatters can help keep React code consistently formatted.

function App() {
    return (
        <h1>Hello React</h1>
    );
}

A consistent formatting style makes code easier to read and maintain.

23. Git Integration

VS Code provides built-in source control features that can be used with Git repositories.

React Project
     ↓
Git Repository
     ↓
VS Code Source Control
     ↓
Commit / Branch / Changes

This allows developers to inspect and manage many Git operations directly from the editor.

24. Debugging Support

VS Code provides debugging capabilities through its development environment and extensions.

Application
     ↓
Debugging
     ↓
Breakpoints
     ↓
Inspect Values
     ↓
Find Problems

Debugging tools can help developers understand how their code runs.

25. Terminal Commands for React

The VS Code terminal can be used to execute commands related to your React project.

node --version
npm --version
npm install
npm run dev

The exact commands available depend on the project configuration.

26. Opening a Project from Terminal

If the VS Code command-line launcher is configured on your system, you can open a project directory from a terminal.

cd my-react-app
code .

The code . command means opening the current directory in VS Code when the command is available.

27. React Project in VS Code

my-react-app/
│
├── public/
│
├── src/
│   ├── App.jsx
│   ├── main.jsx
│   └── components/
│
├── package.json
└── node_modules/

VS Code lets you work with all these files from one project window.

28. Basic VS Code Workflow

Open VS Code
      ↓
Open Project Folder
      ↓
Open Source File
      ↓
Write React Code
      ↓
Open Terminal
      ↓
Run Development Command
      ↓
Test Application
      ↓
Edit Code

29. VS Code Setup Checklist

  • Install VS Code.
  • Open VS Code.
  • Open your React project folder.
  • Verify that the Explorer displays project files.
  • Open the integrated terminal.
  • Check Node.js with node --version.
  • Check npm with npm --version.
  • Install useful extensions when required.
  • Open a React source file.
  • Run the project's development command.

30. Summary of VS Code for React

VS Code provides a convenient development environment for working with React projects. You can manage project files, write JSX and JavaScript, use the integrated terminal, install extensions, work with Git, and debug your application.

VS Code
   ↓
React Project
   ↓
Write JSX / JavaScript
   ↓
Terminal
   ↓
Run Development Tools
   ↓
Test React Application

📌 Key Points

  • VS Code is a source-code editor.
  • VS Code can be used to develop React applications.
  • It supports JavaScript and JSX editing.
  • The Explorer panel helps manage project files.
  • The integrated terminal can run Node.js and npm commands.
  • VS Code supports extensions.
  • VS Code provides code completion and syntax highlighting.
  • VS Code includes source control integration for Git.
  • It provides debugging capabilities.
  • React projects can be opened as folders in VS Code.
  • The code . command can open the current folder when configured.
  • VS Code and Node.js serve different purposes in React development.

🧠 Quick Quiz

Question: What is VS Code mainly used for in React development?