Lección 3 de 10
Props
Props permite pasar datos de un componente padre a un componente hijo. Son de solo lectura: un hijo no debe modificar sus props. Props hace que los componentes sean reutilizables con datos distintos.
REACT
function Greeting(props) {
return <h2>Hello, {props.name}!</h2>;
}
function App() {
return (
<div>
<Greeting name="Ali" />
<Greeting name="Sara" />
<Greeting name="Tom" />
</div>
);
}