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

Error only while compiling: "Argument of type ... is not assignable" #180

Open
diegograziano opened this issue Jun 19, 2019 · 0 comments
Open

Comments

@diegograziano
Copy link

diegograziano commented Jun 19, 2019

Hi, I´am having this issue when I try to compile my project. So, I have to comment the method to continue compiling, but the iziToast works perfectly fine! Any idea? The problem are in the buttons functions, because if I remove them, everything is ok.

iziToast.error({ timeout: 20000, close: true, backgroundColor: '', overlay: true, id: 'borrar_usuario', zindex: 9999, title: '¿Estás seguro que querés eliminar a este usuario?', message: 'Esta acción es irreversible', position: 'center', buttons: [ ['<button><b>Si</b></button>', (instance, toast) => { this .usuariosService.eliminarUsuario(documentId).then(() => { console.log('Usuario eliminado!'); }, (error) => { console.error(error); }), instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); } // (instance, toast) => ], ['<button>No</button>', (instance, toast) => instance.hide({ transitionOut: 'fadeOut' }, toast, 'button')], ] });

I am combining the result (if user click "yes) to delete an entry from a db. It works perfectly, but error still there and bring me problems when compile (serve or deploy). I am newbie in TS, please help!

TS Lint error in VS Code:

Types of property 'buttons' are incompatible.
Type '[string, (instance: IziToast, toast: HTMLDivElement) => void][]' is not assignable to type '[string, (instance: IziToast, toast: HTMLDivElement, button: HTMLButtonElement, event: MouseEvent...'.
Type '[string, (instance: IziToast, toast: HTMLDivElement) => void]' is not assignable to type '[string, (instance: IziToast, toast: HTMLDivElement, button: HTMLButtonElement, event: MouseEvent...'.
Property '2' is missing in type '[string, (instance: IziToast, toast: HTMLDivElement) => void]'.

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant