ant-design / ant-design/codemod-v4

从3 升级到 4 之后ts各种报错

Open
#211 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
99
Forks
24
PR merge metrics
No merged PRs in 30d

Description

例如:
Center/deviceGroup/groupSelect/index.tsx(243,9):
Type '{ selectedRowKeys: string[] | number[]; onChange: (selectedRowKeysArr: string[] | number[], selectedRows: any) => void; }' is not assignable to type 'TableRowSelection'.
Types of property 'onChange' are incompatible.
Type '(selectedRowKeysArr: string[] | number[], selectedRows: any) => void' is not assignable to type '(selectedRowKeys: (string | number)[], selectedRows: any[]) => void'.
Types of parameters 'selectedRowKeysArr' and 'selectedRowKeys' are incompatible.
Type '(string | number)[]' is not assignable to type 'string[] | number[]'.
Type '(string | number)[]' is not assignable to type 'string[]'.
Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with Center/deviceGroup/groupSelect/index.tsx around line 243 and reproduce the TypeScript error after the v3-to-v4 migration. Trace the codemod output and its typing assumptions for TableRowSelection and onChange; done means the migrated code no longer produces this reported type error and related cases are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.