Quick Command Access

  • Posted on July 6, 2024
  • React JS
  • By MmantraTech
  • 147 Views

 Here's a cheatsheet for setting up projects with React, Vite, and Next.js:

Red Black Minimalist Cheat With The Letter Logo -bTE7BC8Egk.png

 

1. Create a React JS App

Using create-react-app

  1. Install create-react-app globally (optional):

     
    npm install -g create-react-app
  2. Create a new React application:

     
    npx create-react-app my-react-app
  3. Navigate to the project directory:

     
    cd my-react-app
  4. Start the development server:

     
    npm start

2. Create a Vite App

Using create-vite

  1. Install Vite (optional):

    npm install -g create-vite
  2. Create a new Vite application:

    npm create vite@latest my-vite-app
  3. Navigate to the project directory:

     
    cd my-vite-app
  4. Install dependencies:

    npm install
  5. Start the development server:

     
    npm run dev

3. Create a Next.js App

Using create-next-app

  1. Install create-next-app globally (optional):

     
    npm install -g create-next-app
  2. Create a new Next.js application:

     
    npx create-next-app my-next-app
  3. Navigate to the project directory:

     
    cd my-next-app
  4. Start the development server:

     
    npm run dev

 

To install SASS in react js project :

npm install -D sass

nstall react-icons:

npm install react-icons

Notes:

  • You can also use yarn instead of npm for package management.
  • For all of these frameworks, it's a good practice to initialize a git repository and create an initial commit:
    bash
     

These commands will get you started with your projects quickly and efficiently!

Author
No Image
Admin
MmantraTech

Mmantra Tech is a online platform that provides knowledge (in the form of blog and articles) into a wide range of subjects .

You May Also Like

Write a Response