What is a “component”? - A component is a modular, portable, replaceable, and reusable set of well-defined functionality that encapsulates its implementation and exporting it as a higher-level interface. It is a software object, intended to interact with other components, encapsulating certain functionality or a set of functionalities.
What are the characteristics of a component? - Reusability, replaceable, not context specific, extensible, encapsulated, independent
What are the advantages of using component-based architecture? - Ease of deployment, reduced cost, ease of development, reusable, modification of technical complexity, reliability, system maintenance and evolution, independent
What is “props” short for? - stands for properties
How are props used in React? - used for passing data from one component to another. Firstly, define an attribute and its value(data). Then pass it to child component(s) by using Props. Finally, render the Props Data
What is the flow of props? - in a uni-directional flow (one way from parent to child)
Component-Based architecture - focuses on the decomposition of the design into individual functional or logical components. The primary objective is to ensure component reusability. The primary objective of component-based architecture is to ensure component reusability.
Views of a Component
Object-oriented view: A component is viewed as a set of one or more cooperating classes.
Conventional view: It is viewed as a functional element or a module of a program that integrates the processing logic, the internal data structures that are required to implement the processing logic and an interface that enables the component to be invoked and data to be passed to it.
Process-related view: Instead of creating each component from scratch, the system is building from existing components maintained in a library.
Props stand for properties and is a special keyword in React
Props are being passed to components like function arguments
Props can only be passed to components in one way (parent to child)