![]() |
In this article, we will see how to install ReactJs with Vite. The Vite is a build tool that provides a faster development experience for modern web projects. Prerequisites:Approach to setup React with Vite:We have discussed below how to setup the Reactjs with Vite, we ensure that Nodejs is installed in our system or not if not then we will install that first, which will create a new Vite project using the terminal writing the command after that we will select the React framework then select the variant then the last step is to install all the dependencies. Steps to set up ReactJS with Vite:Step 1: Install NodeJs, If you haven’t installed NodeJs, download it from the official website. Step 2: Create a new Vite Project npm create vite@latest my-react-app --template Step 3: Select a framework: select the React framework here using the downward arrow key. Vanilla Step 4: Select Variant: choose any variant of your choice using the downward arrow key,i.e: choose JavaScript TypeScript Step 5: Now, switch to my-react-app directory cd my-react-app Step 6: Install Dependencies npm install package.json: "dependencies": { Step 7: Start Server, make sure check your port no on the terminal it may be different for you system. ➜ Local: http://localhost:5173/ Project Structure:![]() Project Structure Example: Let’s build a basic project using React-Vite, In this example, we will develop a user interface component featuring a button, when button clicked, increments a count value.
Output: |
Reffered: https://www.geeksforgeeks.org
ReactJS |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |