Day 55: React Course on Udemy

Styling Stateless Functional Components

// We give our h1 tag a className of "red" so we can target it in our CSS file
var Red = function() {
  return(
    <h1 className="red">Red</h1>
  );
}

ReactDOM.render(
  <Red />,
  document.getElementById("app")
);
// Our CSS file
.red {
  height: 50px;
  width: 150px;
  background-color: red;
}