Last active
October 1, 2018 04:58
-
-
Save dustinheestand/189ed41585c5ae28f042e73461cd0093 to your computer and use it in GitHub Desktop.
This file contains 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
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