Jsx

JSX

what is JSX?

ALL THE GOTCHAS

how to comment in JSX

things allowed and disallowed in JSX

const people = ["Rowe", "Prevost", "Gare"];

const peopleLis = people.map((person, i) => (
  // expression goes here:
  <li key={"person_" + i}>{person}</li>
));

because i want to use ReactJs

React uses JSX (javascript precompiler) which looks like html

Cool stuff : attribute assignment

const pics = {
  panda: "http://bit.ly/1Tqltv5",
  owl: "http://bit.ly/1XGtkM3",
  owlCat: "http://bit.ly/1Upbczi",
};

const panda = <img src={pics.panda} alt="Lazy Panda" />;

const owl = <img src={pics.owl} alt="Unimpressed Owl" />;

const owlCat = <img src={pics.owlCat} alt="Ghastly Abomination" />;