- Props are
arguments
passed into React components. These can also be used to pass data from parent component to child component. - React Props are
read-only
orimmutable
. React will through an error if we try to change their value. - Props are passed to components via
HTML attributes
. In theCar
component,brand
is an example of prop.<Car brand="Ford" />;
- The props can be accessed as shown below.
this
keyword is optional forfunctional
components and required forclass
components<h2>Car Brand is {this.props.brand}</h2>