-
Notifications
You must be signed in to change notification settings - Fork 47.1k
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 multiple child insertion points #848
Comments
@subtleGradient proposed the following:
That would be the equivalent of doing
EDIT: |
A React component can be seen a function. It's arguments are props and local variables is state. If you think as it this way, it actually make sense to pass the title as a prop. What's inside of the tag has a special meaning which is children. It feels like a hack to manipulate and modify the children to split them into different groups. |
Yeah, using props is nice once you think in terms of functions. Thanks |
Briefly spoke to @petehunt about this. Tracking it with an issue.
There are times when having multiple insertion points would be useful. The old Web Components spec was looking to do this with the
select
attribute ofcontent
- http://www.w3.org/TR/components-intro/#insertion-points. I'm not sure what the current W3C plans are.Pete said that this could be done for now by passing other children in as props. But it feels like a hack.
Riffing on that old spec's idea, something vaguely like this:
Where the
.title
string is a CSS selector, and any matching elements are removed from thechildren
to avoid duplicate insertion.The text was updated successfully, but these errors were encountered: