modul:ffit:react:learningunits:lu01:defining-a-component

Dies ist eine alte Version des Dokuments!


LU01a - Creating a component

With function Product() { } you define a JavaScript function with the name Product. This is also going to be our components name

function Product() {
 
}

Every component has to return a value. We create a return( ) with JSX Markup. This is a special Markup Language made for React to write HTML alike in JS.

function Product() {
  return (
    <div>
      <img src="https://i.imgur.com/MK3eW3As.jpg" alt="Katherine Johnson" />
    </div>
  );
}
  • modul/ffit/react/learningunits/lu01/defining-a-component.1733378358.txt.gz
  • Zuletzt geändert: 2024/12/05 06:59
  • von kdemirci