The aim of this exercise is to practice and understand the importance of components.
-
Clone this repository.
-
On your terminal go inside
exercise-lab-components-boilerplate
directory and use the following command:npm install
.This command install's all the packages to your system that this project is using. Here is a link to get a better understanding of what and how exactly the above command works.
- Once everything is ready, you can type
npm run dev
-> inorder to run the application. You should be able to see a server running and see the output as shown below:
By using jsx
, we were able to simply our app a little, but again, we can see that, if our application becomes more complicated, then everything being inside index.jsx
, will just populate the entire file. What if - there is a bug; how will we find as where exactly that bug is coming from -- if the entire code for our application is inside a sinlge file. So, as our project becomes more complex, keeping our entire code in a single file do not make much sense. So your task is to create a component as App.jsx
- and transfer your entire logic to this component. The logic is already provided to you in index.jsx
file.