This repository has been archived by the owner on Aug 21, 2023. It is now read-only.
Blue - v0.0.21
Added method to close Portals from child component
Added the closePortal
method to PortalWrapper
's context, so it can be called from the child component.
Example:
class Contents extends React.Component {
render () {
return (
<p>
<button onClick={this.context.closePortal}>Close me</button>
</p>
)
}
}
Contents.contextTypes = {
closePortal: PropTypes.func
}
return (
<Modal trigger={<Link>Open me</Link>}>
<Contents />
</Modal>
)