How to Install and Set Up React JS v19 with Node.js, Bun, and Vite
Welcome to Thapa Technical's official React v19 series! In this blog, we will guide you through the installation and setup process for React JS v19 using VSCode, Node.js, and Bun package manager. We'll also show you how to create your first "Hello World" program in React and upgrade from React v18 to the v19 Release Candidate (RC). At the end, you'll find the source code and the presentation slides. Let's get started!
Step 1: Installing Node.js
Node.js is essential for running React applications. Follow these steps to install Node.js:
- Visit the Node.js official website.
- Download the LTS version suitable for your operating system.
- Run the installer and follow the prompts to complete the installation.
Step 2: Setting Up Visual Studio Code (VSCode)
VSCode is a powerful and popular code editor for web development. Here's how to set it up:
- Go to the VSCode official website.
- Download and install the latest version for your OS.
- Open VSCode and install the necessary extensions for React development (e.g., ESLint, Prettier).
Step 3: Installing Bun Package Manager
Bun is a fast and modern package manager for JavaScript. Here's how to install it:
- Open your terminal or command prompt.
- Run the following command to install Bun:
- Follow the on-screen instructions to complete the installation.
npm install -g bun (make sure to add -g flag)
If it's not working then 👇
curl -fsSL https://bun.sh/install | bash
Step 4: Creating a React App with Vite
Vite is a build tool that provides a fast and efficient way to set up a React project. Follow these steps to create your first React app:
- Open your terminal or command prompt.
- Run the following commands to create a new React project using Vite:
- Start the development server:
bun create vite@latest reactthapaapp --template react
cd my-react-app
bun install
bun run dev
Step 5: Writing Your First "Hello World" Program
Now that your React app is set up, let's write a simple "Hello World" program:
- Open
src/App.jsx
in VSCode. - Replace the default code with the following:
- Save the file and see the changes live in your browser.
import React from 'react';
function App() {
return (
Hello World
);
}
export default App;
Step 6: Upgrading to React v19 RC
If you're using React v18 and want to upgrade to React v19 Release Candidate, follow these steps:
- Open your terminal or command prompt.
- Run the following command to update React:
bun install react@rc react-dom@rc
Conclusion
Congratulations! You've successfully installed and set up React JS v19 using VSCode, Node.js, Bun, and Vite. You've also created your first "Hello World" program and learned how to upgrade to React v19 RC.
Source Code and Presentation
You can find the source code and the presentation slides for this tutorial here.
Thank you for following along! Stay tuned for more tutorials in our official React v19 series by Thapa Technical.