HTML Element AST JavaScript Object
The HTML Element
object matches a JavaScript HTML Element as the one you have in JSX.
The astType
value for this node is htmlelement
.
Code Pattern
This object captures the following code pattern.
return (
<MyComponent attr="val">
<div>
<ul>
<li>item</li>
</ul>
</div>
</MyComponent>
);
Attributes
tag
(typeAstString
): the tag of the HTML objectopeningTag
(typeHTML Tag
): the tag element (with the position) of the opening tagclosingTag
(typeHTML Tag
): the tag element (with the position) of the closing tagattributes
(array of typeHTMLAttribute
): the list of attributescontent
(array ofAstElement
): arrays that contains all the children of an HTML node.