What is a “component”?
A “component” is a modular and independent unit of software that can be used and reused in various systems or applications. It is a software element that encapsulates certain functionalities and properties that can be utilized by other components or systems.
What are the characteristics of a component?
What are the advantages of using component-based architecture?
What is “props” short for?
“Props” is short for “properties” and refers to a way of passing data from a parent component to a child component in React.
How are props used in React?
Props are used in React by passing data or values as attributes to a child component within the parent component’s JSX. The child component can then access and use these props as necessary. For example, in the parent component’s JSX, the child component might be written as <ChildComponent prop1="value1" prop2="value2" />
. Within the child component, the props can be accessed using props.prop1
and props.prop2
.
What is the flow of props?
The flow of props is unidirectional, meaning they are passed from parent components to child components, but cannot be passed back up to the parent. This helps to maintain the encapsulation and modularity of each component.