Skip to content

Instantly share code, notes, and snippets.

@nicc777
Created September 6, 2019 04:43
Show Gist options
  • Save nicc777/769f145fa533b45c461223ef8cedebf9 to your computer and use it in GitHub Desktop.
Save nicc777/769f145fa533b45c461223ef8cedebf9 to your computer and use it in GitHub Desktop.
Udemy React Course - Section 1.4
<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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment