Skip to content

Instantly share code, notes, and snippets.

@osmelmora
Last active May 11, 2016 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osmelmora/71e7ac077f2bbe590311998e237ca068 to your computer and use it in GitHub Desktop.
Save osmelmora/71e7ac077f2bbe590311998e237ca068 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 liElement1 = React.DOM.li({className: 'item', key: 1}, 'Item 1');
var liElement2 = React.DOM.li({className: 'item', key: 2}, 'Item 2');
var fragment = [liElement1, liElement2];
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