Skip to content

Instantly share code, notes, and snippets.

@AndrewRayCode
Created March 18, 2015 23:33
Show Gist options
  • Save AndrewRayCode/b4c47054fbdb470820c0 to your computer and use it in GitHub Desktop.
Save AndrewRayCode/b4c47054fbdb470820c0 to your computer and use it in GitHub Desktop.
// Top level component
<component>
<UserModal isOpen={this.state.whatever} />
</component>
// UserModal
{
render:function() {
return <BaseModal {...this.props}>
content
</BaseModal>;
}
}
// BaseModal
{
mixins:[OverlayMixin],
renderOverlay: function () {
if (!this.props.isOpen) {
return <span/>;
}
return <Modal {...this.props}>
{this.props.children}
</Modal>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment