choojs / hyperx

🏷 - tagged template string virtual dom builder
BSD 2-Clause "Simplified" License
1.01k stars 48 forks source link

Feature: Allow tags to be set as variables #67

Closed diffcunha closed 6 years ago

diffcunha commented 6 years ago

It would be interesting if tags could be set as variables

const tag = 'div'
const tree = hx`
  <${tag} arg1="foo">
    <span>child</span>
  </${tag}>
`
class Component extends HTMLElement { ... }
const tree = hx`
  <${Component} arg1="foo">
    <span>child</span>
  </${Component}>
`

This could help building support for web components using hyperx

Related to #9