reactjs / reactjs/react-docgen
The description of extended Props is not output correctly
オープン
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 3.8k
- フォーク
- 316
- 平均マージ
- 5時間 7分
- マージ済み PR(30日)
- 4
説明
I created FooProps by extending BarProps, but the description of FooProps is not used; instead, the description of BarProps is adopted.
Input
export interface BarProps {
/** BarProps param1 */
param1: any;
}
export interface FooProps extends BarProps {
/** FooProps param1 */
param1: string;
/** FooProps param2 */
param2: string;
}
export const Foo = (props: FooProps) => {
return <div>foo</div>;
};
output
{
"./src/foo.tsx": [
{
"description": "",
"methods": [],
"displayName": "Foo",
"props": {
"param1": {
"required": true,
"tsType": {
"name": "string"
},
"description": "BarProps param1"
},
"param2": {
"required": true,
"tsType": {
"name": "string"
},
"description": "FooProps param2"
}
}
}
]
}
The props.param1.description should be "FooProps param1" instead of "BarProps param1".
Tested on @react-docgen/cli@3.0.0
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、@react-docgen/cli@3.0.0 を使って TypeScript の例を再現し、継承された Props の説明がどのように選択されるかを調べます。拡張された Props の処理を追跡し、FooProps/BarProps のケースに対するリグレッションテストを追加します。param1 が "FooProps param1" を使用し、継承された Props とその他の Props の説明が正しいままであれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- documentation
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100