4 ms·
Ugh, that is way harder to read than html`<h1>oh hai ${name}</h1>`. They both work without compilation, and they can both compile to the same code anyway. Maybe
by josephg 9y ago
Ugh, that is way harder to read than html`<h1>oh hai ${name}</h1>`. They both work without compilation, and they can both compile to the same code anyway. Maybe you can get used to hyper, but ES6 tagged template literals are much easier on the eyes.
- Vinnl 9y agoMaybe > h1(`oh hai ${name}`) is harder to read than > html`<h1>oh hai ${name}</h1>` for some people, but even then your editor can understand that that is a function, can tell you when you've mistyped it, can autocomplete it for you, and can give you hints on what arguments it takes (since it has TypeScript definitions). And as a bonus for me, I also find the former easier to read than the latter, but that might just be getting used to it :)
- idbehold 9y agoThe "tag" part of a tagged template literal is a function so maybe your editor should be updated to recognize them.