Skip to content

Instantly share code, notes, and snippets.

@crisberrios
Created February 4, 2016 20:35
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 crisberrios/4ab2f6726fbf09e1652f to your computer and use it in GitHub Desktop.
Save crisberrios/4ab2f6726fbf09e1652f to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNext Bin Sketch</title>
<!-- put additional styles and scripts here -->
</head>
<body>
<!-- put markup and other contents here -->
<div id="app"></div>
</body>
</html>
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
let React = require('react');
let ReactDOM = require('react-dom');
const Hello = ({children, ...props}) => <div {...props}>Hello {children}</div>;
ReactDOM.render(<Hello>World</Hello>, document.getElementById('app'));
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"babel-runtime": "6.3.19",
"react": "0.14.7",
"react-dom": "0.14.7"
}
}
'use strict';
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
var React = require('react');
var ReactDOM = require('react-dom');
var Hello = function Hello(_ref) {
var children = _ref.children;
var props = (0, _objectWithoutProperties3.default)(_ref, ['children']);
return React.createElement(
'div',
props,
'Hello ',
children
);
};
ReactDOM.render(React.createElement(
Hello,
null,
'World'
), document.getElementById('app'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment