Created
August 18, 2016 22:02
-
-
Save iammerrick/8e0284b667d69bf47610287a98144285 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
class MyWrapper extends React.Component { | |
componentDidMount() { | |
this.setState({ | |
instance: new WhateverIAmWrapping(this.node) | |
}); | |
} | |
render() { | |
return ( | |
<div ref={(ref) => this.node } /> | |
{this.state.instance ? ( | |
<div> | |
<HandleWhateverForInstance instance={this.state.instance} /> | |
<HandleSomethingElseForInstance instance={this.state.instance} /> | |
</div> | |
) : null} | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment