You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BaseCascaderProps fails TS2430 (placement) under exactOptionalPropertyTypes #671
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):
@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.
Opened #672 with the NonNullable<BaseSelectPropsWithoutPrivate['placement']> fix (plus the #670 constraint widening in the same file). Verified with tsc 6.0.3 and 7.0.2 under your tsconfig flags — the TS2430 disappears and the whole package declaration file reports zero errors.
Activity
young-tree commentedon Nov 19, 2026
Opened #672 with the
NonNullable<BaseSelectPropsWithoutPrivate['placement']>fix (plus the #670 constraint widening in the same file). Verified with tsc 6.0.3 and 7.0.2 under your tsconfig flags — the TS2430 disappears and the whole package declaration file reports zero errors.