Created
July 19, 2015 19:52
-
-
Save anonymous/1c558fa873d06850ff09 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/jeguti
This file contains hidden or 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> | |
<script src="http://fb.me/react-with-addons-0.13.1.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="container"></div> | |
<script id="jsbin-javascript"> | |
"use strict"; | |
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | |
var MyComponent = (function (_React$Component) { | |
function MyComponent() { | |
_classCallCheck(this, MyComponent); | |
if (_React$Component != null) { | |
_React$Component.apply(this, arguments); | |
} | |
} | |
_inherits(MyComponent, _React$Component); | |
_createClass(MyComponent, [{ | |
key: "render", | |
value: function render() { | |
return React.createElement( | |
"div", | |
null, | |
"Hello World" | |
); | |
} | |
}]); | |
return MyComponent; | |
})(React.Component); | |
React.render(React.createElement(MyComponent, null), document.getElementById("container")); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<script src="//fb.me/react-with-addons-0.13.1.js"><\/script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="container"></div> | |
</body> | |
</html></script> | |
<script id="jsbin-source-javascript" type="text/javascript">class MyComponent extends React.Component { | |
render() { | |
return (<div>Hello World</div>); | |
} | |
} | |
React.render(<MyComponent />, document.getElementById("container"));</script></body> | |
</html> |
This file contains hidden or 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 _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | |
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | |
var MyComponent = (function (_React$Component) { | |
function MyComponent() { | |
_classCallCheck(this, MyComponent); | |
if (_React$Component != null) { | |
_React$Component.apply(this, arguments); | |
} | |
} | |
_inherits(MyComponent, _React$Component); | |
_createClass(MyComponent, [{ | |
key: "render", | |
value: function render() { | |
return React.createElement( | |
"div", | |
null, | |
"Hello World" | |
); | |
} | |
}]); | |
return MyComponent; | |
})(React.Component); | |
React.render(React.createElement(MyComponent, null), document.getElementById("container")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment