In this video.
Let's see how to create a React component.
We have two ways of creating React component and one is functional component and class based component.
So what is the differences between these two?
Well, if we have experience with React, you we see that before the current version of React, we normally
go by what is called class based component.
For example, if we want to use some lifecycle lifecycle method, but with the current version of React,
where they introduce hooks, where we are sticking to functional component and that is what React is
moving towards using functional component.
So I can say that class based component is deprecated and everything are going to use functional component.
So to demonstrate that, let's go ahead and create Fresh React app and then we start from scratch.
So I'm going to create a folder on my index top and I'll call it as React Components.
You can name it wherever you want.
React that component.
Like that and then have open mind terminal or better still, you can use the built in terminal that
came with Visual Studio code.
There are a couple of ways of doing this.
One is I can see in I can drag and drop my folder onto my terminal and then I'm good to go.
Let me clear the console.
Well, remember guys, how can we create React app making use of PNP X Create Dash React Dash app and
the name of your app React component and then you are good to go.
But let me show you one code trick here.
Remember that we can go by this way.
It means that I'm going to create this folder inside this folder here.
But I already have my folder.
Well, I don't want to have some folder inside this one.
So if you have your folder being already created, all you need to do is you don't need to bring the
name of your project, but instead space and period and hit enter.
So it's going to install React into the folder that we have created.
So let's have some patience and then sit back and wait.
Why React is doing it thing.
Well React has finished installing and it says that first is we have already segued into that summit
kinds of and PM start and then I'm good to go because I'm already inside my project folder so let me
click the console and make use of NPM start or better.
So let me open the folder inside my preferred cool editor I can drag and drop or mechanics of this script
code dot and then it's going to open for me.
So let make it large and then let me run my React application, click the console again and then MP
and start and I'm starting my React app.