Skip to content

Instantly share code, notes, and snippets.

@osmelmora
Last active May 11, 2016 20:16
Show Gist options
  • Save osmelmora/23742ab2856cd28ca338a6961a05ae22 to your computer and use it in GitHub Desktop.
Save osmelmora/23742ab2856cd28ca338a6961a05ae22 to your computer and use it in GitHub Desktop.
<!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>
</head>
<body>
<div id="example"></div>
<script type="text/javascript">
var fragment = ['Item 1', 'Item 2'].map(function (title, i) {
return React.DOM.li({className: 'item', key: i}, title);
});
var itemsList = React.createElement(
'ul',
{className: 'list'},
fragment
);
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