I am trying to have a SweetAlert2 dialog showing two buttons, with the following code snippet:
swal('Some text', {
buttons: {
buttonA: {
text: 'Some text',
value: 'buttonA',
className: 'some-class'
},
buttonB: {
text: 'Some other text',
value: 'buttonB',
className: 'some-class'
}
},
buttonsStyling: false
}).then((result) => {
switch (result) {
case 'buttonA':
// Do something
break;
default:
// Do something else
}
})
But I get the following error message:
SweetAlert2: Unexpected type of html! Expected "string", got object
Also, the dialog only shows one "OK" button
What am I doing wrong ?