microsoft / microsoft/TypeScript

Useless scary elaboration on all overloads in JSX

オープン
#35,908 コメント 2 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Experience Enhancement Suggestion
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

git clone https://github.com/React95/React95/
git checkout 57dc66d8a087792fd8fa0f1cfb7c7560767e8520
yarn
  1. Open up VS Code in the base

  2. Open up the file packages/core/components/Checkbox.jsx

  3. Go to line 100

  4. Make a change

    - <Label {...style} checked={checked} disabled={disabled}>
    + <Label style={style} checked={checked} disabled={disabled}>
    

Observe the error message:

No overload matches this call.
  Overload 1 of 2, '(props: Pick<Pick<Pick<DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "form" | ... 255 more ... | "htmlFor"> & { ...; }, "form" | ... 256 more ... | "htmlFor"> & Partial<...>, "form" | ... 256 more ... | "htmlFor"> & { ...; } & { ...; }): ReactElement<...>', gave the following error.
    Type '{ children: Element[]; style: any; checked: any; disabled: any; }' is not assignable to type 'IntrinsicAttributes & Pick<Pick<Pick<DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "form" | ... 255 more ... | "htmlFor"> & { ...; }, "form" | ... 256 more ... | "htmlFor"> & Partial<...>, "form" | ... 256 more ... | "htmlFor"> & { ...; } & { ...; }'.
      Property 'checked' does not exist on type 'IntrinsicAttributes & Pick<Pick<Pick<DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "form" | ... 255 more ... | "htmlFor"> & { ...; }, "form" | ... 256 more ... | "htmlFor"> & Partial<...>, "form" | ... 256 more ... | "htmlFor"> & { ...; } & { ...; }'.
  Overload 2 of 2, '(props: StyledComponentPropsWithAs<"label", any, {}, never>): ReactElement<StyledComponentPropsWithAs<"label", any, {}, never>, string | ... 1 more ... | (new (props: any) => Component<...>)>', gave the following error.
    Type '{ children: Element[]; style: any; checked: any; disabled: any; }' is not assignable to type 'IntrinsicAttributes & Pick<Pick<Pick<DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "form" | ... 255 more ... | "htmlFor"> & { ...; }, "form" | ... 256 more ... | "htmlFor"> & Partial<...>, "form" | ... 256 more ... | "htmlFor"> & { ...; } & { ...; }'.
      Property 'checked' does not exist on type 'IntrinsicAttributes & Pick<Pick<Pick<DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "form" | ... 255 more ... | "htmlFor"> & { ...; }, "form" | ... 256 more ... | "htmlFor"> & Partial<...>, "form" | ... 256 more ... | "htmlFor"> & { ...; } & { ...; }'.ts(2769)

image

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リポジトリをクローンして報告された yarn setup を実行し、提供された TypeScript の診断を使って packages/core/components/Checkbox.jsx の 100 行目にある JSX の変更を再現します。まず、JSX 呼び出しのオーバーロードエラーがどのようにフォーマットされるかを追跡します。同じ無効な prop について、オーバーロードの詳細全体を重複させずに該当するエラーが報告されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react, typescript
領域
compilers
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。