This is my code which i want render CarReport
component in a sweetalert modal. <CarReport />
is just a simple form.
Swal.fire({
title: "..."
html: <CarReport />, //How to write this line?
confirmButtonText: "Check",
preConfirm: () => {
//api request
},
});
Currently this code opens the modal but shows [object object] in body of the modal.
SweetAlert2 does not support react components. For that it requires using