What is Props in React ?

Photo by Toa Heftiba on Unsplash

What is Props in React ?

Props is just an another name for properties. Props help us in order to pass the required information/data/state to the component via HTML attributes. Properties are read-only and immutable unlike states.

Let's take a real world scenario. A component needs a properties of color red to a different component to pass the data. We use props as in means of transport to deliver the required data to the wanted component.

Props.jpg

Furthermore Props are essential to make the code dynamic following the DRY method. As it helps us to "Don't Repeat Yourself" in order for the code to be not repetitive. React Props are like function arguments in JavaScript and attributes in HTML.