This code does not work.
const render = ({title, tag, values}) => {
bind(document.body)`
<h1>${title}</h1>
<div>
<${tag} data=${values}></${tag}>
</div>
`
}
render({title: "test", tag: "custom-elem1", values: {foo: "bar"}})
Can I change tag dynamically using hyperHTML?
You might not like the answer but it's nope, you can't.
The reason is that hyperHTML, like any other similar library, doesn't work with strings, it works with DOM, and in the DOM world you cannot change a tag name, even if you try.
What you could do instead, is to return the element you like.
In that case, you can do whatever you want, as long as you won't try to change DOM tags nature on the fly, 'cause not even hyperHTML can do that