Last active
October 31, 2018 16:42
-
-
Save wellyal/3ffef5ac6a395c56ed254878234d97af to your computer and use it in GitHub Desktop.
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 characters
import React, { Component } from 'react' | |
class ElmComponent extends Component { | |
shouldComponentUpdate(prevProps) { | |
return false; | |
} | |
render() { | |
return <div ref={this.initialize}/> | |
} | |
initialize = node => { | |
if (!node) return; | |
const app = this.props.src.init({ node, flags: this.props.flags }) | |
if (typeof this.props.ports !== 'undefined') { | |
this.props.ports(app.ports); | |
} | |
} | |
} | |
export default ElmComponent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment