InterviewSolution
| 1. |
What are props in React? |
|
Answer» The props in React are the inputs to a component of React. They can be single-valued or objects having a set of values that will be passed to components of React during creation by USING a naming convention that almost LOOKS similar to HTML-tag attributes. We can say that props are the data passed from a parent component into a child component. The main purpose of props is to provide different component functionalities such as:
For example, consider we are creating an element with reactProp property as given below: <Element reactProp = "1" /> |
|