made with esnextbin
Last active
March 10, 2016 03:19
-
-
Save bfitch/769f7e1644f883b2ee9f to your computer and use it in GitHub Desktop.
esnextbin sketch
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>ESNextbin Sketch</title> | |
<!-- put additional styles and scripts here --> | |
</head> | |
<body> | |
<div id="app"></div> | |
</body> | |
</html> |
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
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')); |
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
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0", | |
"dependencies": { | |
"react": "0.14.7", | |
"react-dom": "0.14.7" | |
} | |
} |
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
'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