Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

The JSX namespace docs lack concrete examples

未关闭
#3,251 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript
领域
documentation

调研方向

从 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

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/TypeScript-Website 的其他 Issue

查看 microsoft/TypeScript-Website 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。