adobe / react-webcomponent

This projects automates the wrapping of a React component in a CustomElement.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow capturing of child content into the web component

cuberoot opened this issue · comments

Expected Behaviour

This is a feature request.

There should be a @byContent decorator that would allow capturing of arbitrary DOM content that the web component user has placed into a wrapped web component.

                <popover open={ true } title="Title">
                    <section>
                        <button on-click={ (event) => this.handleClick(event) }>Push Me</button>
                    </section>
                </popover>

So, if popover is a wrapped web component, we want the user to be able to pass our component content to put inside our component.

class PopoverModel extends DOMModel {
	@byAttrVal() title;
	@byBooleanAttrVal() open = true;
	@byContent('section') content;
}

So, once the above model was parsed, there would be a content field that would contain a React component that you could render into the React component that you are wrapping.