React

by MathyouMB

HTML

<div id="app"></div>

CSS

.square{
  width:6em;
  height:6em;
}

React

function Square(props) {
  
  let Style = {
      backgroundColor:props.bgColor,
   };

  return (
    <div style={Style} className="square"></div>
  );
}

function App(){
  return(
  <div>
  
  <Square bgColor="red"/>
  
  </div>
  )
}

ReactDOM.render(<App />, document.querySelector("#app"))