Let’s take an example if you want to print your family members’ details that is the name, age, and profession, etc. Now, one way is you make one div for your info than another div for your mother, father, etc. It will look so clumsy something like this, a lot of div’s are used in the below example.

<div>
  <div>
     <p> name is manu </p>
     <span> age is 22 </span>
  </div>
  <div>
     <p> name is abc</p>
     <span> age is 27 </span>
  </div>
  <div>
     <p> name is xyz</p>
     <span> age is 25</span>
  </div>
<div>

So, in place of a big structure what we can do is make one common structure and then pass information in some way that we don’t have to create so many div’s. Here, comes the need for props in React JS.

#coding #props #react-for-begineers #basic-react #react-course #react

Props In React JS
2.70 GEEK