Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function as children #160

Closed
chbdetta opened this issue Aug 30, 2017 · 2 comments
Closed

Function as children #160

chbdetta opened this issue Aug 30, 2017 · 2 comments

Comments

@chbdetta
Copy link

chbdetta commented Aug 30, 2017

What about adding the support for function children so codes below can be valid

<Portal openByClickOn ={<a>test</a>}>{(closePortal) => (
  <Modal>
    {/*some content*/}
    <button onClick={closePortal()}>close me</button>
  </Modal>
)}</Portal>

I could just inline the portal content without creating a component class / stateless functional comp to use the closePortal

@tajo
Copy link
Owner

tajo commented Sep 27, 2017

Yes. This is a great pattern and I will use it in v4.

@tajo
Copy link
Owner

tajo commented Oct 1, 2017

Used in #157

@tajo tajo closed this as completed Oct 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants