Die Skepping van Kinderkomponente in React

Nie net stringe nie, maar ook veranderlikes en konstantes kan in die eienskappe van 'n komponent se merkers oorgedra word:

jsxfunction App() {
  const name = 'produk';
  const cost = '100';
  
  return <div>
    <Product name={name} cost={cost} />
  </div>;
}

Kom ons maak dadelik verskeie produkte:

jsxfunction App() {
  const name1  = 'produk1';
  const cost1 = '100';
  
  const name2  = 'produk2';
  const cost2 = '100';
  
  const name3  = 'produk3';
  const cost3 = '100';
  
  return <div>
    <Product name={name1} cost={cost1} />
    <Product name={name2} cost={cost2} />
    <Product name={name3} cost={cost3} />
  </div>;
}
Задание 1

Probeer dit wat geleer is op een van jou eie komponente uit.