PreviewGroup declarations fail strict type checking with TS2430 in 1.10.1
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 74/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- react, typescript
- 領域
- frontend
研究方向
Issue 指出已發布的宣告 @rc-component/[email protected] PreviewGroup.d.ts,並提供一個啟用 strict 模式的最小 TypeScript 重現範例。安裝列出的相依套件並執行 npx tsc 命令以確認 TS2430,接著檢查 group 與共用 preview config 的宣告。完成條件是 strict 檢查通過,且 group 回呼仍可將 info.current 用作數字。
由索引模型根據 Issue 內容生成。
描述
PR #529 proposes a fix for this error. Here is a minimal reproduction using the published npm package.
Reproduction
In an empty directory:
npm init -y
npm install @rc-component/[email protected] react@18 react-dom@18
npm install -D [email protected] @types/[email protected] @types/react-dom@18
echo "import '@rc-component/image/es/PreviewGroup';" > index.ts
npx tsc --noEmit --strict --skipLibCheck false --target es2020 --module esnext --moduleResolution bundler index.ts
Actual result
PreviewGroup.d.ts(6,18): error TS2430: Interface 'GroupPreviewConfig' incorrectly extends interface 'InternalPreviewConfig'.
Types of property 'imageRender' are incompatible.
The shared callback accepts info.current?: number, while the group callback requires info.current: number. The same error also reproduces with @types/[email protected].
Expected result
The published declarations should pass strict checking, and group callbacks should still be able to use info.current as a number.
- 主要語言
- TypeScript
- 星號
- 211
- 分支
- 128
- 平均合併
- 2 天 23 小時
- 30 天內合併 PR
- 1
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
react-component/image 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 45/100
react-component/image#482 ·
-
難度 3/5 1-2 天 新手友好度 45/100
react-component/image#430 · 1 個 reaction ·
-
難度 4/5 3-5 天 新手友好度 35/100
react-component/image#375 ·
-
難度 4/5 3-5 天 新手友好度 25/100
react-component/image#374 ·
-
Image组件是否可以使用forwardRef定义,目前无法传入ref可能已有人在做 @liamli-0822 於 639 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 42/100
react-component/image#372 · 1 則留言 ·
查看 react-component/image 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 83/100
維護者通常 1 天內回覆
-
Codex使用可 かんたん コード
難度 2/5 1-3 小時 新手友好度 72/100
ryuki-moro/Nicomaru#348 ·
維護者通常 1 天內回覆
-
clawsweeper:fix-shape-clear clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:crash-loop issue-rating: 🦞 diamond lobster P2
難度 2/5 1-3 小時 新手友好度 82/100
openclaw/openclaw#211919 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 77/100
維護者通常 1 天內回覆
-
Bug
難度 1/5 1 小時以內 新手友好度 84/100
維護者通常 1 天內回覆