The JSX namespace docs lack concrete examples
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- documentation
Research direction
Start with the JSX namespace section at typescriptlang.org/docs/handbook/jsx.html#the-jsx-namespace and reproduce the behavior in the linked TypeScript playgrounds. Compare the documented namespace patterns with the linked tsconfig.json and src/BehaviorTree/btJsx.ts examples. Done means the page includes concrete, working examples for a custom JSX factory and a non-global namespace such as preact's h.JSX.
Written by the indexing model from the issue text.
Description
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.)
- Dominant language
- TypeScript
- Stars
- 2.6k
- Forks
- 1.5k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 8
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/TypeScript-Website
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
microsoft/TypeScript-Website#3611 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/TypeScript-Website#3607 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
microsoft/TypeScript-Website#3039 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
microsoft/TypeScript-Website#2998 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
microsoft/TypeScript-Website#3614 ·
All issues in microsoft/TypeScript-Website
Similar issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100