Introduction to React and Components
What is a component?
- Architectural elements that provide and/or require interfaces and are connected to each other.
- A component is a section of code that can be reused.
What is Props?
React is a component-based library which divides the UI into little reusable pieces. In some cases, those components need to communicate (send data to each other) and the way to pass data between components is by using props.
How are props used in React?
- Props are like parameters to a function
- Props can only be passed in a uni-direction i.e (parent to child)
- Props can be used to pass dynamic data to a component
What are the charactistics of a component?
- Resusability
- Replaceable
- Extensible
- Encapsulated
- Independent