pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🐛[BUG] 打包编译错误本地正常

Open 1353823765 opened this issue 1 year ago • 1 comments

export declare function useControlModel<T extends FormControlProps>({ value, onChange, id }: WithControlPropsType, model?: T): ControlModelType; export declare function useControlModel<const T extends readonly string[]> ({ value, onChange, id }: WithControlPropsType, model ?: T): { [P in T[number]]: ControlModelType; }; export declare function useControlModel<const T extends readonly FormControlMultiProps[]> ({ value, onChange, id }: WithControlPropsType, model ?: T): { [P in GetArrayFieldType<T>]: ControlModelType; }; /

🐛 bug 描述

2.7最新的版本本地没问题打包会提示ts编译错误,显示 /./node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]/node_modules/@ant-design/pro-form/es/components/FormItemRender/index.d.ts:24:41 [17:53:27] Type error: Type parameter declaration expected. [17:53:27] [17:53:27] 22 | }[]> = T[number]['name']; [17:53:27] 23 | export declare function useControlModel<T extends FormControlProps>({ value, onChange, id }: WithControlPropsType, model?: T): ControlModelType; [17:53:27] > 24 | export declare function useControlModel<const T extends readonly string[]>({ value, onChange, id }: WithControlPropsType, model?: T): { [17:53:27] | ^ [17:53:27] 25 | [P in T[number]]: ControlModelType; [17:53:27] 26 | }; [17:53:27] 27 | export declare function useControlModel<const T extends readonly FormControlMultiProps[]>({ value, onChange, id }: WithControlPropsType, model?: T): {

📷 复现步骤

🏞 期望结果

💻 复现代码

© 版本信息

  • ProComponents 版本: [e.g. 4.0.0]
  • umi 版本
  • 浏览器环境
  • 开发环境 [e.g. mac OS]

🚑 其他信息

1353823765 avatar Apr 19 '24 12:04 1353823765

参考 https://github.com/ant-design/pro-components/issues/8217 可以检查一下ts版本

yummyLcj avatar Apr 26 '24 06:04 yummyLcj