Create any html tag in Svelte using it's name as string
yarn add is-velte
& <Is tag="h1">Hello Svelte</Is>
Basically, I created that component to have a bit more of flexibility when creating specific Svelte components that handle multiple html tags.
So, the only way I manage to do this is to actually change by hand some parts of a Svelte generated component code, both the Client and Server version.
Because that, the peer dependency will be strict tied to a Svelte release version, updating every time we had a new Svelte release.
yarn add is-velte
Then:
import Is from 'is-velte';
And:
<Is tag='section'> My Section </Is>
The "tag" property is a "div" by default!