Link Search Menu Expand Document

Intro to React and Components

Reading

Component-Based Architecture

What is a “component”?

  • A react component is a small element that is used to establish a specific piece of an app or website. Think of it as a single lego piece that can be modified without needing to completely tear down and reconstruct the overall lego model

What are the characteristics of a component?

  • Reusability − Components are usually designed to be reused in different situations in different applications. However, some components may be designed for a specific task.

  • Replaceable − Components may be freely substituted with other similar components.

  • Not context specific − Components are designed to operate in different environments and contexts.

  • Extensible − A component can be extended from existing components to provide new behavior.

  • Encapsulated − A component depicts the interfaces, which allow the caller to use its functionality, and do not expose details of the internal processes or any internal variables or state.

  • Independent − Components are designed to have minimal dependencies on other components.

What are the advantages of using component-based architecture?

  • Ease of deployment − As new compatible versions become available, it is easier to replace existing versions with no impact on the other components or the system as a whole.

  • Reduced cost − The use of third-party components allows you to spread the cost of development and maintenance.

  • Ease of development − Components implement well-known interfaces to provide defined functionality, allowing development without impacting other parts of the system.

  • Reusable − The use of reusable components means that they can be used to spread the development and maintenance cost across several applications or systems.

  • Modification of technical complexity − A component modifies the complexity through the use of a component container and its services.

  • Reliability − The overall system reliability increases since the reliability of each individual component enhances the reliability of the whole system via reuse.

  • System maintenance and evolution − Easy to change and update the implementation without affecting the rest of the system.

  • Independent − Independency and flexible connectivity of components. Independent development of components by different groups in parallel. Productivity for software development and future software development.

What is Props and How to Use it in React

What is “props” short for?

  • Props is short for properties

How are props used in React?

  • Props pass data from one component to another

What is the flow of props?

  • Props have a one directional flow

Bookmark and Review

React Tutorial through ‘Passing Data Through Props’

React Docs - Hello world

React Docs - Introducing JSX

React Docs - Rendering elements

React Docs - Components and props