Created
May 11, 2016 20:27
-
-
Save osmelmora/ef4aad5ef7d77b5cd981c81977afe6a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Hello React</title> | |
<script src="https://fb.me/react-15.0.2.js"></script> | |
<script src="https://fb.me/react-dom-15.0.2.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script> | |
</head> | |
<body> | |
<div id="example"></div> | |
<script type="text/babel"> | |
var items = ['Item 1', 'Item 2'].map(function (title, i) { | |
return <li className='item' key={i}>{title}</li>; | |
}); | |
var itemsList = ( | |
<ul className='list'> | |
{items} | |
</ul> | |
); | |
ReactDOM.render( | |
itemsList, | |
document.getElementById('example') | |
); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment