Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

The JSX namespace docs lack concrete examples

Đang mở
#3,251 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu với phần namespace JSX tại typescriptlang.org/docs/handbook/jsx.html#the-jsx-namespace và tái hiện hành vi trong các TypeScript playground được liên kết. So sánh các mẫu namespace được ghi trong tài liệu với các ví dụ tsconfig.json và src/BehaviorTree/btJsx.ts được liên kết. Hoàn tất khi trang có các ví dụ cụ thể, hoạt động được về một JSX factory tùy chỉnh và một namespace không toàn cục như preact's h.JSX.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.)

Ngôn ngữ chính
TypeScript
Star
2.6k
Fork
1.5k
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
8

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/TypeScript-Website

Tất cả issue của microsoft/TypeScript-Website

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.