made with esnextbin
Created
February 22, 2016 19:58
-
-
Save jfsiii/5efc59d971d55a2e3537 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> | |
<!-- put markup and other contents here --> | |
<div id="react-root"></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' | |
class ComponentA extends Component { | |
render() { | |
return <div className="ComponetA">ComponentA</div> | |
} | |
} | |
class ComponentB extends Component { | |
render() { | |
return <div className="ComponetB">ComponentB</div> | |
} | |
} | |
class App extends Component { | |
render() { | |
return ( | |
<div> | |
<ComponentA /> | |
<ComponentB /> | |
</div> | |
); | |
} | |
} | |
render( | |
<App />, | |
document.getElementById('react-root') | |
) |
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": { | |
"babel-runtime": "6.3.19", | |
"react-dom": "0.14.7", | |
"react": "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 _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = require('babel-runtime/helpers/createClass'); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = require('babel-runtime/helpers/inherits'); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _react = require('react'); | |
var _react2 = _interopRequireDefault(_react); | |
var _reactDom = require('react-dom'); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var ComponentA = (function (_Component) { | |
(0, _inherits3.default)(ComponentA, _Component); | |
function ComponentA() { | |
(0, _classCallCheck3.default)(this, ComponentA); | |
return (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(ComponentA).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(ComponentA, [{ | |
key: 'render', | |
value: function render() { | |
return _react2.default.createElement( | |
'div', | |
{ className: 'ComponetA' }, | |
'ComponentA' | |
); | |
} | |
}]); | |
return ComponentA; | |
})(_react.Component); | |
var ComponentB = (function (_Component2) { | |
(0, _inherits3.default)(ComponentB, _Component2); | |
function ComponentB() { | |
(0, _classCallCheck3.default)(this, ComponentB); | |
return (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(ComponentB).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(ComponentB, [{ | |
key: 'render', | |
value: function render() { | |
return _react2.default.createElement( | |
'div', | |
{ className: 'ComponetB' }, | |
'ComponentB' | |
); | |
} | |
}]); | |
return ComponentB; | |
})(_react.Component); | |
var App = (function (_Component3) { | |
(0, _inherits3.default)(App, _Component3); | |
function App() { | |
(0, _classCallCheck3.default)(this, App); | |
return (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(App).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(App, [{ | |
key: 'render', | |
value: function render() { | |
return _react2.default.createElement( | |
'div', | |
null, | |
_react2.default.createElement(ComponentA, null), | |
_react2.default.createElement(ComponentB, null) | |
); | |
} | |
}]); | |
return App; | |
})(_react.Component); | |
(0, _reactDom.render)(_react2.default.createElement(App, null), document.getElementById('react-root')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment