Doing the practical...
A Pen by Nico Coetzee on CodePen.
<div id="app"></div> |
function Person(props) { | |
return ( | |
<div className="person"> | |
<h1>{props.name}</h1> | |
<p>Your Age: {props.age}</p> | |
</div> | |
); | |
} | |
var app = ( | |
<div> | |
<Person name="Pete" age="26"/> | |
<Person name="Sannie" age="16"/> | |
</div> | |
); | |
ReactDOM.render(app, document.querySelector('#app')); |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.9.0/umd/react.production.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.8.6/umd/react-dom.production.min.js"></script> |
.person { | |
display: inline-block; | |
margin: 10px; | |
border: 1px solid #eee; | |
box-shadow: 0 2px 2px #ccc; | |
width: 200px; | |
padding: 20px; | |
} |
Doing the practical...
A Pen by Nico Coetzee on CodePen.