Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Blue - v0.0.21

Compare
Choose a tag to compare
@Charca Charca released this 14 Sep 13:26
· 3279 commits to main since this release

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>
)