Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"deprecated: 'danger' value of 'nzType' in Button" after updating to v10.2.1 #6191

Closed
hedegitsinue opened this issue Dec 14, 2020 · 1 comment · Fixed by #6193
Closed

"deprecated: 'danger' value of 'nzType' in Button" after updating to v10.2.1 #6191

hedegitsinue opened this issue Dec 14, 2020 · 1 comment · Fixed by #6193
Assignees

Comments

@hedegitsinue
Copy link

hedegitsinue commented Dec 14, 2020

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-ivy-pzsfrs?file=src/app/app.component.ts

Steps to reproduce

  • Install [email protected]
  • Insert <button nz-button nzType="primary">...</button> in the template (Any value with nzType will give the same warning)

What is expected?

It should not give any warnings

What is actually happening?

It gives the warning in the console as

[NG-ZORRO]: deprecated: 'danger' value of 'nzType' in Button is going to be removed in 12.0.0. Please use 'nzDanger' instead

Environment Info
ng-zorro-antd 10.2.1
Browser Chrome

My guess is that it is caused by
type NzLegacyButtonType = 'primary' | 'default' | 'dashed' | 'danger' | 'link' | 'text' | null; which contains danger value and triggers this warning.

I was not able to edit the file in node_modules after npm runs postinstall and therefore was not able to check if removing the danger value solves the issue.

@Airblader
Copy link
Collaborator

It seems that this should check the type being used rather than check for any nzType being set.

Airblader added a commit to Airblader/ng-zorro-antd that referenced this issue Dec 14, 2020
Only warn about the deprecated nzType="danger" value if that value
is actually used rather than any value for nzType.

fixes NG-ZORRO#6191
hsuanxyz pushed a commit that referenced this issue Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment