Skip to content

Latest commit

 

History

History
35 lines (18 loc) · 1.16 KB

Reading-3-01.md

File metadata and controls

35 lines (18 loc) · 1.16 KB

Introduction to React and Components

Component-Based Architecture

  1. A component is a software object with a defined functionality that is able to interact with with other components.

  2. Characteristics of components

    1. Reusable: can be used in different situations and applications

    2. Replaceable: can be swapped out for similar components

    3. Not context specific: can be used in multiple environments

    4. Extensible: can be extended from other components to produce new behavior

    5. Encapsulated: can be used without revealing internal processes or variables

    6. Independent: do not depend on other components

  3. The advantages of component-based architecture include ease of development, deployment, maintenance, and evolution as well as increased reliability.

What is Props and How to Use it in React

  1. Props is short for properties and is used to pass read-only data from parent components to child components.

  2. Props are used in a 3 step process.

    1. Firstly, define an attribute and its value(data)

    2. Then pass it to child component(s) by using Props

    3. Finally, render the Props Data

  3. Props flow from parent to child.