TypeScript: Missing Union Elements of Indexed Access Type
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- react, typescript
- 領域
- documentation, tooling
調査の方向性
Issue の TypeScript 例から始めて、react-docgen playground で再現します。indexed-access type がどのように処理されるかを追跡し、次に期待される union literal 要素のカバレッジを追加して、生成された JSON に示されている 3 つのリテラルが含まれることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Hello there,
In the following code, the elements of the size props are not outputted.
type Base = {
size: "small" | "medium" | "large";
};
type Props = {
size: Base["size"];
}
const MyComponent = ({size}: Props) => {
return <div />;
}
Result
[
{
"description": "",
"displayName": "MyComponent",
"methods": [],
"props": {
"size": {
"required": true,
"tsType": {
"name": "union",
"raw": "Base[\"size\"]"
},
"description": ""
}
}
}
]
Expected Behavior
[
{
"description": "",
"displayName": "MyComponent",
"methods": [],
"props": {
"size": {
"required": true,
"tsType": {
"name": "union",
"raw": "\"small\" | \"medium\" | \"large\"",
"elements": [
{
"name": "literal",
"value": "\"small\""
},
{
"name": "literal",
"value": "\"medium\""
},
{
"name": "literal",
"value": "\"large\""
}
]
},
"description": ""
}
}
}
]
I reproduced it here:
https://react-docgen.dev/playground
Thanks for regards.
- 主要言語
- TypeScript
- スター
- 3.8k
- フォーク
- 316
- 平均マージ
- 3時間 28分
- マージ済み PR(30日)
- 6
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
reactjs/react-docgen のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
reactjs/react-docgen#1102 ·
-
Typescript Status オープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
reactjs/react-docgen#1005 · リアクション 4 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
reactjs/react-docgen#997 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
reactjs/react-docgen#994 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
reactjs/react-docgen#982 · コメント 2 件 ·
reactjs/react-docgen の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
ontola/atomic-server#1625 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
melgarafael/DeskcommCRM#1451 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
-
bug via-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bot:ai-assisted component:compact-js status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
midnightntwrk/midnight-sdk#403 ·