React 2
React 2
Function based component- In this you can do same but in lesser line of codes with
less complexity.They are not quite easy to work.
when you are writing complex functions it was prefferd to
use class based as it was easy to work with.
./ means whenever you are importing a file from the same folder.It means same
folder.
../ means if you are importing a file from one step back. It means one folder
back.
../../ It means two folders back.
* Package.json-
Codesandbosx code-
*render - it means display whatever component is inside it inside the given div.It
means loading the given component on to the screen.
AFter running the program it will generate a URL i.e local host 3000. When you
are making a project on offline mode then you can
view the project in http://localhost:3000
COMPONENT-
How it Works?
index.html-> Index some component in index.js file-> setup React -> create VDOM ->
Set a command and target App.jsx.