The JSX namespace docs lack concrete examples
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
调研方向
从 typescriptlang.org/docs/handbook/jsx.html#the-jsx-namespace 的 JSX 命名空间部分开始,并在链接的 TypeScript playgrounds 中复现其行为。将文档中介绍的命名空间模式与链接的 tsconfig.json 和 src/BehaviorTree/btJsx.ts 示例进行比较。当页面包含自定义 JSX factory 和类似 preact's h.JSX 的非全局命名空间的具体可运行示例时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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.)
- 主要语言
- TypeScript
- 星标
- 2.6k
- 派生
- 1.5k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 8
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/TypeScript-Website 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
microsoft/TypeScript-Website#3611 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/TypeScript-Website#3607 ·
-
难度 1/5 1 小时以内 新手友好度 65/100
microsoft/TypeScript-Website#3039 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
microsoft/TypeScript-Website#2998 ·
-
难度 3/5 1-2 天 新手友好度 68/100
microsoft/TypeScript-Website#3614 ·
查看 microsoft/TypeScript-Website 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
mksglu/context-mode#1200 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/claude-code#96687 ·
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
AOSSIE-Org/DebateAI#582 · 2 条评论 ·