Skip to content

Support multiple child insertion points #848

Closed
@necolas

Description

@necolas

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 of content - 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:

<div>
  <div class="header">
    { select(this.props.children, '.title') }
  </div>
  { this.props.children }
</div>

Where the .title string is a CSS selector, and any matching elements are removed from the children to avoid duplicate insertion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions