-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Types of property 'buttons' are incompatible #763
Comments
|
Error became like:
|
You are facing a typescript error, make sure to follow these types
It seems
|
Why should I add this code? I couldn't get what I have to do |
Why aren´t the options optional in typescript? You have to pass all values instead of the ones you need. jQuery for example does it like:
|
@splitt3r You're right, they should definitely be optional. If anyone wants to send a pull request to fix this, feel free to! |
|
|
Thanks, I worked with Angular 10 , Swal.fire({ |
Hi,
I'm getting "Types of property 'buttons' are incompatible" error in my component. Here is the code and error:
I'm getting
Argument of type '{ title: string; text: string; icon: string; dangerMode: true; buttons: { cancel: string; ok: str...' is not assignableto parameter of type 'string | Partial<SwalOptions>'. Type '{ title: string; text: string; icon: string; dangerMode: true; buttons: { cancel: string; ok: str...' is not assignable to type 'Partial<SwalOptions>'. Types of property 'buttons' are incompatible. Type '{ cancel: string; ok: string; }' is not assignable to type 'ButtonList'. Property 'cancel' is incompatible with index signature. Type 'string' is not assignable to type 'ButtonOptions'.
What can be the reason?
The text was updated successfully, but these errors were encountered: