Skip to content

Instantly share code, notes, and snippets.

@bfitch
Last active March 10, 2016 03:19
Show Gist options
  • Save bfitch/769f7e1644f883b2ee9f to your computer and use it in GitHub Desktop.
Save bfitch/769f7e1644f883b2ee9f to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<!-- put additional styles and scripts here -->
</head>
<body>
<div id="app"></div>
</body>
</html>
import React,{Component} from 'react';
import {render} from 'react-dom';
const people = [
{name: 'John'},
{name: 'Brian'}
]
const NameList = (props) => {
return (
<div>
{props.people.map(person => <div>Hello, {person.name}</div>)}
</div>
);
}
render(<NameList people={people}/>, document.getElementById('app'));
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"react": "0.14.7",
"react-dom": "0.14.7"
}
}
'use strict';
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactDom = require('react-dom');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var people = [{ name: 'John' }, { name: 'Brian' }];
var NameList = function NameList(props) {
return _react2.default.createElement(
'div',
null,
props.people.map(function (person) {
return _react2.default.createElement(
'div',
null,
'Hello, ',
person.name
);
})
);
};
(0, _reactDom.render)(_react2.default.createElement(NameList, { people: people }), document.getElementById('app'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment