-
Hey developers!
-
In this video, I'm going to show you how to install
-
React app using vite in your project.
-
So for that, first of all, I'm going to my
browser.
-
And search vite.dev which is the official
documentation
-
Of vite.
-
So here if you scroll down, you will see the command line that is used
-
to install the React app. npm create vite at latest.
-
So copy this line and go to command prompt
of your PC.
-
And then, paste the line in the
command prompt.
-
And press enter.
-
And then again, press enter.
-
And now, you have to give a project
name.
-
So, I'm giving first react project.
-
And then press enter and now we have to
select a framework.
-
Which is react of course.
-
Now we have to select a variant which is JavaScript. XML, JSX.
-
Now, we have to change our
directory to the first
-
react project folder.
-
So, let's copy this line and paste it
again in the command prompt.
-
And-- And press enter.
-
Now, npm install in order to install
all the required packages
-
For the react-- react project.
-
It will automatically install all the necessary
packages that you will need.
-
In your react app.
-
Now, based on your internet--
internet speed, it will take a few moments.
-
And make sure you have already downloaded
node.js.
-
So, it's now installing all the
packages.
-
And yeah. They've installed.
-
And now, before typing npm
run dev.
-
Let's go to our visual studio code.
-
And again go to our command prompt.
-
And type npm run dev.
-
And then press enter.
-
Now, you will-- you will see there's--
we have got a link.
-
The local host. Now you can copy
this one or press the control button.
-
Of your keyboard and then
click on the link.
-
And a new page will be opened in your browser.
-
If your page-- if your window looks like this,
then your react project is ready.
-
Now, to check this, you go to the
VS code in the src folder.
-
In app.jsx. Let's delete something from-- from this folder-- from this file.
-
Let's delete this div.
-
To check whether it works or not.
-
Now save it and go to the browser.
-
Yeah, it works!
-
Let's check it again.
-
Let's say, we write here h1. h1 tag
and inside it, let's write, "Hello world"
-
Um... this is my first react project
using vite.
-
Now save it.
And again go to the browser.
-
Yeah, it works!
-
So, this is how you install
react app in your-- to use in your project.
-
Using vite.
-
And that's all for today. Don't forget
to like this video.
-
And comment down to share your
thoughts.
-
Have a good day!