Hello React World

Know how to install react and react-dom and add Babel to codepen.io/pen and this react app will run😎️

index.html

<div id="p1"></div>
<div id="p2"></div>

styles.css

.person{
  display: inline-block;
  margin: 10px;
  border: 1px solid #eee;
  box-shadow: 0 2px 2px #ccc;
  width: 200px;
  padding: 20px;
}

script.js

function Person({name, age}){
  return (
    <div className="person">
      <h1>{name}</h1>
      <p>Your Age: {age}</p>
    </div>  
  ); 
}
ReactDOM.render(<Person name="Max" age="28" />, document.querySelector("#p1"));

ReactDOM.render(<Person name="Shigart" age="66" />, document.querySelector("#p2"));

No Comments Yet