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

Support named children #528

Closed
matt-gadd opened this issue Sep 10, 2019 · 0 comments · Fixed by #544
Closed

Support named children #528

matt-gadd opened this issue Sep 10, 2019 · 0 comments · Fixed by #544
Labels
area: core Core next Issue/Pull Request for the next major version

Comments

@matt-gadd
Copy link
Contributor

Enhancement
Up to now when when we've been using render props in widgets we've used a by convention renderer property. This kind of works for a single renderer, but not for many and because this is only by convention we can't for certain know what property is a render prop. In 7 we'd like to propose a change to our children behaviour to support named renderers, it would look something like:

<SplitPane>
{
  {
    left() => <div>Left Item</div>,
    right() => <div>Right Item</div>
  }
}
</SplitPane>

or

<SplitPane>
{
  () => ({
    left: <div>Left Item</div>,
    right: <div>Right Item</div>
  })
}
</SplitPane>

As part of this we might need to move children to the properties interface to allow this to be inferred by TSX.

With this in place we should be able to write a better harness to deal with render props.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Core next Issue/Pull Request for the next major version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant