2

I am facing one issue to pass body from aura component to lwc.

optionGroup.html

<template>
  <h1>Child LWC</h1>
  <slot></slot>
</template> 

OptionGroupLWC.html

<template>
  <h1>Parent LWC</h1>
  <slot></slot>
  <c-option-group>
    <p>child slot</p>
  </c-option-group>
</template>

OptionGroupExample.cmp

<aura:component implements="flexipage:availableForAllPageTypes">
  <c:optionGroupLWC>
    <p>Parent Slot</p>
  </c:optionGroupLWC>
</aura:component>

Output:

enter image description here

Issue is <p>Parent Slot</p> does not render from aura component to slot in lwc.

1 Answer 1

3

As stated in the documentation:

If a Lightning web component contains a slot, you cannot nest it in an Aura component.

I am afraid there is also no alternative for passing in aura facets to lwc - so for that particular Web Component you will not be able to wrap it in an old aura component

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .