Introduction to React and Components
- Component Based Architecture
- What is a component?
A Component is one of the core building blocks of React. In other words, we can say that every application you will develop in React will be made up of pieces called components. Components make the task of building UIs much easier. You can see a UI broken down into multiple individual pieces called components and work on them independently and merge them all in a parent component which will be your final UI.
2.What are the charactistics of a component?
-
Reusability
-
Replaceable
-
Not context specific
-
Extensible
-
Encapsulated
-
Independent
3.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 and How to Use it in React?
- What is props short for?
properties and is being used for passing data from one component to another.
2.How are props used in React?
- Firstly, define an attribute and its value(data)
- Then pass it to child component(s) by using Props
- Finally, render the Props Data
2.What is the flow of props? Flow will statically ensure that you are using the component in the way it was designed to be used.