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

The JSX namespace docs lack concrete examples #3251

Open
Telokis opened this issue Oct 12, 2024 · 0 comments
Open

The JSX namespace docs lack concrete examples #3251

Telokis opened this issue Oct 12, 2024 · 0 comments

Comments

@Telokis
Copy link

Telokis commented Oct 12, 2024

Page URL: https://www.typescriptlang.org/docs/handbook/jsx.html#the-jsx-namespace

I've spent way too many hours trying to understand how to create my own JSX factory and let TS recognize it properly.
In the past I've asked a StackOverflow question which finally made the thing work.
Today, I've tried changing my implementation so I can use a non-global namespace like the docs suggest preact does with h and h.JSX.
However, I never managed to make that work, I tried all kinds of things. This led me to believe that the docs themselves are extremely lacking and, in particular, lack very concrete examples of how to make it work entirely.
And, to emphasize, I really am talking about the namespace definition itself, NOT its content which is quite easy to understand by reading the following sections on the page.
Though the sections are clear, they still use code that don't work as-is. For example, this playground and this one do not work as described by the comments because the namespace is probably wrongly defined.

(If, for any reason, you want to see where I'm at: my tsconfig.json and my factory/types.)

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

1 participant