Introduction to React and Components
Component Based Architecture
- What is a component?
A component is a software object, intended to interact with other components, encapsulating certain functionality or a set of functionalities.
- What are the charactistics 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 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?
-
Reduced time in market and the development cost by reusing existing components.
-
Increased reliability with the reuse of the existing components.
What is Props and How to Use it in React
- What is props short for?
- Properties
- How are props used in React?
- passing data from one component to another
- What is the flow of props?
- uni-directional flow (one way from parent to child)