harshit-2708 / intro-react

A robot powered training repository :robot:
https://lab.github.com/githubtraining/introduction-to-react
MIT License
0 stars 0 forks source link

Changes #2

Open harshit-2708 opened 4 years ago

github-learning-lab[bot] commented 4 years ago

Building Blocks of Life Apps - Components

Awesome! You successfully opened a pull request!

In this Pull Request you will:

First, we'll learn about components.

Components

Components are the building blocks of React apps. Think of components as different parts of the app. Each button is a component, each paragraph of text is a component, and so on. From html, you might recognize some of the built in components like <div /> and <li />. In React, we can create our own components! How cool is that?

Components in src/App.jsx

Assignments Solution

In our solution, our assignments page looks like the above. The overall webpage is a component called App. Inside App there are other components like buttons, titles, and custom components that we can create (like the Assginments List).

Take a look at the following line in src/App.jsx.

class App extends React.Component

This line takes a component's properties to create a component named "App". In the render method of App, there are other components like <button/>. These components are child components because they are all a part of its parent, App.

Scroll down to add a header component.