BaseCascaderProps fails TS2430 (placement) under exactOptionalPropertyTypes
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript
調査の方向性
es/Cascader.d.ts の placement 宣言から始め、@rc-component/select の基底プロパティと比較してください。TypeScript 6.0.3、exactOptionalPropertyTypes: true、skipLibCheck: false で報告された TS2430 を再現してください。これらの設定でそのエラーが発生しなくなれば、issue は完了です。
索引モデルが issue の本文から書いたものです。
説明
With @rc-component/cascader 1.26.0 (resolved by antd 6.7.0), TypeScript 6.0.3, strict, exactOptionalPropertyTypes: true and skipLibCheck: false, the published declaration reports an error on its own (no user code needed):
// index.ts
import type { CascaderProps } from "@rc-component/cascader";
export type Props = CascaderProps;
@rc-component/cascader/es/Cascader.d.ts(25,11): error TS2430: Interface 'BaseCascaderProps<OptionType, ValueField>' incorrectly extends interface 'Omit<BaseSelectPropsWithoutPrivate, "mode" | "showSearch" | "tokenSeparators" | "labelInValue">'.
Types of property 'placement' are incompatible.
Type 'Placement | undefined' is not assignable to type 'Placement'.
Type 'undefined' is not assignable to type 'Placement'.
Cause: es/Cascader.d.ts:58 redeclares placement?: BaseSelectPropsWithoutPrivate['placement'];. Indexed access on the optional base property yields Placement | undefined, while @rc-component/select 1.12.0 declares placement?: Placement. Under exactOptionalPropertyTypes the redeclaration is no longer assignable to the base.
Possible fix: placement?: NonNullable<BaseSelectPropsWithoutPrivate['placement']> (or placement?: Placement).
With exactOptionalPropertyTypes: false the same file compiles with 0 errors. The same declaration file also reports the TS2344 errors tracked in #670.
Versions: @rc-component/cascader 1.26.0, @rc-component/select 1.12.0, antd 6.7.0, TypeScript 6.0.3, @types/react 19.3.0, @types/react-dom 19.3.0, Node 24.21.0.
tsconfig:
{
"compilerOptions": {
"target": "ES2024",
"lib": ["ES2024", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "Bundler",
"jsx": "react-jsx",
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"skipLibCheck": false,
"noEmit": true,
"types": ["react", "react-dom"]
},
"files": ["index.ts"]
}
- 主要言語
- TypeScript
- スター
- 235
- フォーク
- 153
- 平均マージ
- 8分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react-component/cascader のほかの issue
-
BaseOptionType fails Required<OptionType> constraint under exactOptionalPropertyTypes対応中かも @young-tree が 15 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
react-component/cascader#670 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
react-component/cascader#594 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
react-component/cascader#540 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
react-component/cascader#539 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
react-component/cascader#468 ·
react-component/cascader の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
Techiebutler/freeframe#687 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信
-
enhancement from-app needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
nightly-labs/openbot#23050 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
vercel-labs/skills#2967 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
OHDSI/Data2Evidence#3846 ·
メンテナーはふだん 3 日以内に返信