Created
July 20, 2016 22:57
Revisions
-
nrako created this gist
Jul 20, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ // Welcome! require() some modules from npm (like you were using browserify) // and then hit Run Code to run your code on the right side. // Modules get downloaded from browserify-cdn and bundled in your browser. var React = require('react') var ReactDOM = require('react-dom') var Resizable = require('react-component-resizable').default var WindowResizable = React.createClass({ getInitialState: function(){ return { width: 0, height: 0 }; }, render: function(){ console.log(this.state); var width = this.state.width, height = this.state.height; var div = React.createElement('div', {className: 'fill'}, width + 'x' + height); return React.createElement(Resizable, {onResize: this.onResize}, div); }, onResize: function(resizeAttributes){ var width = resizeAttributes.width, height = resizeAttributes.height; this.setState({width: width, height: height}); } }); ReactDOM.render(React.createElement(WindowResizable), document.getElementById('example')); 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ { "name": "requirebin-sketch", "version": "1.0.0", "dependencies": { "react": "15.2.1", "react-dom": "15.2.1", "react-component-resizable": "1.0.2" } } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ <!-- contents of this file will be placed inside the <body> --> <div id="example"></div> 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ <!-- contents of this file will be placed inside the <head> --> <style type="text/css"> body, html{ height: 100%; } div{ height: 100%; } .fill{ height: 100%; } </style> 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ made with [requirebin](http://requirebin.com)