Lesson 3 of 10
Props
Props (short for properties) let you pass data from a parent component to a child component. They are read-only — a child cannot modify its props. Props make components reusable with different data.
REACT
function Greeting(props) {
return <h2>Hello, {props.name}!</h2>;
}
function App() {
return (
<div>
<Greeting name="Ali" />
<Greeting name="Sara" />
<Greeting name="Tom" />
</div>
);
}