Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why are HTML tags declared as strings? #21

Open
codethief opened this issue Dec 1, 2020 · 2 comments
Open

Why are HTML tags declared as strings? #21

codethief opened this issue Dec 1, 2020 · 2 comments

Comments

@codethief
Copy link

codethief commented Dec 1, 2020

Forgive my ignorance but why does the example from the README

// example.tsx
import * as elements from 'typed-html';

const w = 'world';
const helloWorld = <p>Hello <strong>{w}</strong></p>;

typeof helloWorld; // => Just a string of course

yield a string? Wouldn't it make more sense for helloWorld to be of type HTMLElement, so that

  1. it can be easily appended to existing DOM elements?
  2. everything's type-safe and one could do introspection on those HTMLElements?
@TechStudent10
Copy link

2. everything's type-safe and one could do introspection on those HTMLElements?

I'm also curious about this

@arthurfiorette
Copy link

This package aims to generate html strings. Probably looking for https://github.com/alex-kinokon/jsx-dom#readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants