How to create a React 19 app with Vite?

Setting Up Your React 19 App: A Complete Walkthrough

Photo by Rahul Mishra on Unsplash

When writing this article, running npm init vite@latest wasn’t the express route to a React 19 app. 🚀

To kickstart your shiny new ⚛ React 19 project, you’ll need to take a couple of extra steps. Here’s how to do it like a pro:

Step 1: Create a new app with vite. It will use React 18

npm create vite@latest

Step 2: Run bellow commands to get react 19

npm install react@latest react-dom@latest

Step 3: Optional (Run these commands to update the types)

npm install --save-dev @types/react@latest @types/react-dom@latest

Step 4: Run And Code 🚀

And if you are upgrading, check the official docs for upgrading steps.

https://react.dev/blog/2024/04/25/react-19-upgrade-guide

--

--

राहुल मिश्रा
राहुल मिश्रा

Responses (1)