3

I am trying to leverage the new lightning-input-rich-text component functionality(font sizing and link) in my Aura component. I have tried adding the component in many ways and none of them work. I get Invalid Descriptor Format.

Here is what i have tried:
<lightning-input-rich-text  ><lightning-input-rich-text>
<c:lightning-input-rich-text    ></c:lightning-input-rich-text>
<lightning:lightning-input-rich-text    ></lightning:lightning-input-rich-text>

Is this that I am trying even possible?

1

2 Answers 2

4

Yes you should be able to do this by wrapping up the LWC base component in a custom LWC Component. You can use custom LWC component in an Aura Component. Use this link to understand how to use custom LWC in aura component: https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.interop_aura_composition This way you should be able to use benifit of LWC with existing AURA Component.

    <!-- Wrapper LWC - - >
    <template>
           <lightning-input-rich-text ....></lightning-input-rich-text>
    </template>

    <!-- AURA cmp - - >
    <c:Wrapper onchange="{! c.changeHandler}" />
4
  • Thank you, i had tried this in the past and it worked, i was hoping there was another way where i did not have to create a wrapper component. Commented Apr 30, 2019 at 19:40
  • I believe there is no other way around to achieve this. Due to naming convention difference between LWC and , you will always endup using the Aura version of the base component. Just curious, what's the missing functionality in Aura. Commented Apr 30, 2019 at 19:47
  • In aura you can't add links to the rich text developer.salesforce.com/docs/component-library/bundle/… Commented Apr 30, 2019 at 19:51
  • 1
    You should not have to create a wrapper around the lightning base component. The OP just has to use the right naming convention, <lightning:inputRichText> in their aura component. Commented Jan 20, 2020 at 22:05
4

In Aura you write with Aura syntax, so you reference the components the same way you have always done in Aura regardless of what type of component it is (Aura or LWC)

<aura:component>
  <lightning:button/>
  <c:myFancyComponent/>
</aura:component>

Note that in the example above either component can be implemented in Aura or LWC and it will work the same.

There is no need for wrappers at all, that is done for you in a layer we call “interoperability”. The fundamental point of this layer is to abstract you from knowing anything about LWC if you are in Aura.

You must log in to answer this question.

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