DEV Community

KIRUBAGARAN .K
KIRUBAGARAN .K

Posted on

How to create react applications

Steps to Create a React App using Vite

Follow these steps in your terminal to create a new React application

Navigate to the directory where you want to create your project (optional)

Run the create command using your preferred package manager (npm, yarn, or pnpm):

npm create vite@latest

Alternatively, you can specify the project name and template directly for a non-interactive setup

npm create vite@latest my-react-app -- --template react

my-react-app is the name of your project. This command will create a new directory with this name

Follow the interactive prompts

  • Enter your project name.
  • Select React as the framework.
  • Choose your preferred variant (JavaScript or TypeScript)

Navigate into your new project directory

cd my-react-app

Install the necessary dependencies:

npm install

Start the development server

npm run dev

Top comments (0)