Search code examples
angularng-zorro-antd

Angular upgrade to v16 and Ant Design error: 'nzComponentParams' does not exist in type 'ModalOptions'


I am upgrading a set of Angular applications from v12 to v16, and I've run into this error. It seems to have do with typescript or Ant Design.

TS2345: Argument of type '{ nzTitle: string; nzContent: typeof ConfirmAddRfidsComponent; nzComponentParams: { prevProps: any; tableRef: any; }; }' is not assignable to parameter of type 'ModalOptions<ConfirmAddRfidsComponent, any, any>'.
  Object literal may only specify known properties, and 'nzComponentParams' does not exist in type 'ModalOptions<ConfirmAddRfidsComponent, any, any>'.

I've upgraded to Typescript v4.9.5 per the Angular upgrade guide. And Ant Design to v16.2.0.


Solution

  • "nzComponentParams is deprecated, will be removed to the next major version, prefer using nzData."

    nzComponentParams was remove in v16 (#7930) (baab16c) https://ng.ant.design/docs/changelog/en