Skip to content

Instantly share code, notes, and snippets.

@anatomic
Created March 28, 2017 22:40
Show Gist options
  • Save anatomic/af2efd8084744cbfd00d4eb0c2bbad79 to your computer and use it in GitHub Desktop.
Save anatomic/af2efd8084744cbfd00d4eb0c2bbad79 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/gukiwufare
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.my-list {
padding: 0;
margin: 0;
list-style: none;
}
.my-item{
font-style: italic;
}
</style>
</head>
<body>
<script src="https://fb.me/react-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>
<div id="app"></div>
<script id="jsbin-javascript">
"use strict";
var container = document.getElementById("app");
var listWrapper = React.createElement.bind(null, 'ul', { className: "my-list" });
var listItem = function listItem(item) {
return React.createElement('li', { className: "my-item" }, item);
};
var list = listWrapper.apply(null, ["foo", "bar", "baz"].map(listItem));
console.log(list);
ReactDOM.render(list, container);
</script>
<script id="jsbin-source-css" type="text/css">.my-list {
padding: 0;
margin: 0;
list-style: none;
}
.my-item{
font-style: italic;
}</script>
<script id="jsbin-source-javascript" type="text/javascript">const container = document.getElementById("app");
const listWrapper = React.createElement.bind(null, 'ul', { className: "my-list" });
const listItem = item => React.createElement('li', {className: "my-item"}, item);
const list = listWrapper.apply(null, ["foo", "bar", "baz"].map(listItem));
console.log(list);
ReactDOM.render(list, container);</script></body>
</html>
.my-list {
padding: 0;
margin: 0;
list-style: none;
}
.my-item{
font-style: italic;
}
"use strict";
var container = document.getElementById("app");
var listWrapper = React.createElement.bind(null, 'ul', { className: "my-list" });
var listItem = function listItem(item) {
return React.createElement('li', { className: "my-item" }, item);
};
var list = listWrapper.apply(null, ["foo", "bar", "baz"].map(listItem));
console.log(list);
ReactDOM.render(list, container);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment