Props
Props übergeben
<Pizza
name="Pizza Spinaci"
ingredients="Tomato, mozarella, spinach, and ricotta cheese"
photoName="pizzas/spinaci.jpg"
price={12}
/>Props annehmen
const Pizza = (props) => {
return (
<div>
<img src={props.photoName} alt={props.name} />
<h3>{props.name}</h3>
<p>{props.ingredients}</p>
</div>
);
}
export default Pizza;Prop-Types
Last updated