Skip to content

Instantly share code, notes, and snippets.

@TN1ck
Created March 8, 2017 18:34
Show Gist options
  • Save TN1ck/e5104bfd11d25caa380799c363971562 to your computer and use it in GitHub Desktop.
Save TN1ck/e5104bfd11d25caa380799c363971562 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<style>
.draggable-box {
width: 50px;
height: 50px;
color: red;
}
</style>
<!-- put additional styles and scripts here -->
</head>
<body>
<div id='root'></div>
</body>
</html>
import * as React from 'react';
import * as ReactDOM from 'react-dom';
class DraggableBox extends React.Component {
render () {
return (
<div className='draggable-box'></div>
);
}
}
ReactDOM.render(
<DraggableBox />,
document.getElementById('root')
)
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"react": "15.4.2",
"react-dom": "15.4.2",
"babel-runtime": "6.22.0"
}
}
'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 React = _interopRequireWildcard(_react);
var _reactDom = require('react-dom');
var ReactDOM = _interopRequireWildcard(_reactDom);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var DraggableBox = function (_React$Component) {
(0, _inherits3.default)(DraggableBox, _React$Component);
function DraggableBox() {
(0, _classCallCheck3.default)(this, DraggableBox);
return (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(DraggableBox).apply(this, arguments));
}
(0, _createClass3.default)(DraggableBox, [{
key: 'render',
value: function render() {
return React.createElement('div', { className: 'draggable-box' });
}
}]);
return DraggableBox;
}(React.Component);
ReactDOM.render(React.createElement(DraggableBox, null), document.getElementById('root'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment