4

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?

DavGin
  • 8,205
  • 2
  • 19
  • 26
  • 2
    It is the exact same thing. I personnaly use `property` in my code because readability and certainty are more important that 4 characters lazyness. Same thing with `err` instead of `error` or `cb` instead of `callback`. – Eric MORAND Aug 04 '21 at 09:35
  • 1
    this has confused me so profoundly as I keep seeing the word `prop` everywhere and it's sort of "scaring" me bc I can't tell if it simply means `property` or something else :/ – Prid Jun 01 '22 at 18:27

1 Answers1

2

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.

James Lin
  • 21
  • 3