-
-
Notifications
You must be signed in to change notification settings - Fork 832
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
"@stencil/core": "4.42.0",
Current Behavior
I have been taking advantage of the new Mixin from stencil core. I love it. It has helped me to share reused logic across components. I ran into an issue though when I added helper methods to render jsx. For example:
renderLabel = () => (
<label class="form-field__label" htmlFor={this.controlId}>
{this.required ? (
<span class="form-field__required-indicator">*</span>
) : null}
<slot name="label"></slot>
</label>
);The helper works correctly, but because I moved my slot into the mixin when the component is compiled it does not register that there is any slot logic in the component and ignores them.
We are using light DOM components by the way, and simply adding a hidden slot to the component like,
<slot name="__stencil-slot-sentinel__" />
Makes the component work as expected.
Expected Behavior
I would like stencil compiler to crawl the Mixin logic to see if slots are being added via the mixin.
System Info
Steps to Reproduce
Add a Mixin that has a render method that renders a <slot /> and notice it not handling the slot logic if there are not other slots outside of the mixin in the component.
Code Reproduction URL
https://github.com/blakeplumb/fork-stencil-starter
Additional Information
No response