how to render

What should this tag render ? Is anything missing this tag as

<aura:html tag="div" body="Iam inside  div tag " />

as per sfdc documentation https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_html.htm
this is first class object in lightning

Answer

Like any other component in aura, the body attribute accepts array of Aura.Component instances(Aura.Component[]).

In our case aura:html expects body to be of type Aura.Component[].I think it is ignored because of the type mismatch.

You can set the aura:html’s body attribute in the markup implictly by doing this:

<aura:html tag="div">Hello World</aura:html>

Anything within the start tag and end tag be it a custom component, aura/ui/lightning namespaced component is considered as the body of that particular component.

Attribution
Source : Link , Question Author : JaySun , Answer Author : Praveen

Leave a Comment