Skip to content

Instantly share code, notes, and snippets.

@dustinheestand
Last active September 22, 2018 15:48
Show Gist options
  • Save dustinheestand/1ae73775fdbcef20dc2c33f3a6555121 to your computer and use it in GitHub Desktop.
Save dustinheestand/1ae73775fdbcef20dc2c33f3a6555121 to your computer and use it in GitHub Desktop.
var React = require('react');
var createReactClass = require('create-react-class');
module.exports = createReactClass({
initialize: function (node) {
if (node === null) return;
var app = this.props.src.embed(node, this.props.flags);
if (typeof this.props.ports !== 'undefined') {
this.props.ports(app.ports);
}
},
shouldComponentUpdate: function (prevProps) {
return false;
},
render: function () {
return React.createElement('div', { ref: this.initialize });
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment