Skip to content

Instantly share code, notes, and snippets.

@dustinheestand
Last active October 1, 2018 04:58
Show Gist options
  • Save dustinheestand/189ed41585c5ae28f042e73461cd0093 to your computer and use it in GitHub Desktop.
Save dustinheestand/189ed41585c5ae28f042e73461cd0093 to your computer and use it in GitHub Desktop.
var React = require('react')
export default class Elm extends React.Component {
ref = node => {
if (node === null) return
const app = this.props.src.init({node, flags: this.props.flags})
if (typeof this.props.ports !== 'undefined') this.props.ports(app.ports)
}
shouldComponentUpdate = () => {
return false
}
render = () => {
return <div ref={this.ref} />
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment