score:0

where on earth are propname and componentname defined?

those are parameters that get passed in to your function by the prop-types library. propname is the name of the prop that's being tested ("text" in this case) and componentname is the name of the component ("message" in this case);

here's the line in prop-types which calls your function

you can control what value is used for componentname by adding a displayname property to your component, as in:

const message = ({text}) => <p>{text}</p>
message.displayname = "aardvark";

if no .displayname is provided, then the function's .name property is used instead (assuming the function isn't anonymous)


Related Query

More Query from same tag