Skip to content

Commit 55e13c1

Browse files
authored
jsx-to-htm: leading underscore = reference tag
In JSX, a leading underscore in tag names denotes a reference tag (Component): ```js var x = <_Foo /> // should output: var x = html`<${_Foo} />` ```
1 parent c51b1e0 commit 55e13c1

File tree

1 file changed

+1
-1
lines changed
  • packages/babel-plugin-transform-jsx-to-htm

1 file changed

+1
-1
lines changed

packages/babel-plugin-transform-jsx-to-htm/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default function jsxToHtmBabelPlugin({ types: t }, options = {}) {
9292
const open = node.openingElement;
9393
const { name } = open.name;
9494

95-
if (name.match(/^[A-Z]/)) {
95+
if (name.match(/^[_A-Z]/)) {
9696
raw('<');
9797
expr(t.identifier(name));
9898
}

0 commit comments

Comments
 (0)