Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a difference between a "prop" and a "property" in general?

This is a vocabulary concept introduced in most web frontend frameworks of today. The parameters that are passed to a component are called "props", whether in React or Vue, for instance.

Even the official documentations refers to the word "prop" all over the place, including in translated versions.

I personally prefer to use the full word "property" because "prop" sounds a little weird to my ears. I agree, that is quite a subjective perception.

As "prop" is so widely used, is it just a shorthand for "property" or a slightly different concept I should be aware of?

like image 959
DavGin Avatar asked Oct 28 '25 04:10

DavGin


1 Answers

As you suspected, “props” is just short for “properties”. The old React docs say this directly (https://legacy.reactjs.org/docs/components-and-props.html):

This function is a valid React component because it accepts a single “props” (which stands for properties) object argument with data and returns a React element.

like image 58
James Lin Avatar answered Oct 30 '25 03:10

James Lin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!