ant-design / pro-components

🏆 Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.04k stars 1.29k forks source link

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

Open 1353823765 opened 3 weeks ago

1353823765 commented 3 weeks ago

export declare function useControlModel({ value, onChange, id }: WithControlPropsType, model?: T): ControlModelType; export declare function useControlModel<const T extends readonly string[]> ({ value, onChange, id }: WithControlPropsType, model ?: T): {

}; export declare function useControlModel<const T extends readonly FormControlMultiProps[]> ({ value, onChange, id }: WithControlPropsType, model ?: T): {

}; /

🐛 bug 描述

2.7最新的版本本地没问题打包会提示ts编译错误,显示 /./node_modules/.pnpm/@ant-design+pro-form@2.26.0_antd@5.16.2_rc-field-form@1.44.0_react-dom@18.2.0_react@18.2.0/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({ 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] 26 | }; [17:53:27] 27 | export declare function useControlModel<const T extends readonly FormControlMultiProps[]>({ value, onChange, id }: WithControlPropsType, model?: T): {

📷 复现步骤

🏞 期望结果

💻 复现代码

© 版本信息

🚑 其他信息

yummyLcj commented 2 weeks ago

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