Skip to main content

Command Palette

Search for a command to run...

What is Props in React ?

Updated
1 min read
What is Props in React ?
K

I am passionate about creating seamless web experiences with modern technologies. My unwavering commitment to staying at the forefront of the industry is fueled by a goal for continuous learning and professional development.

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.