Props and Component Reusability

Props (short for properties) are used to pass data from one component to another.

function Greeting(props) {
  return <p>Hi, {props.name}!</p>;
}

<Greeting name="Alice" />
<Greeting name="Bob" />
  • Props are read-only.
  • Enable component reuse with different data.
← PrevNext →