sweetalert2-react
sweetalert2-react copied to clipboard
window is not defined in nextjs
"window is not defined" in nextjs project. Actually window in not available at server side. So, i am using this hack https://github.com/zeit/next.js/issues/2473#issuecomment-362119102 . but this does not work everytime, it will be helpful if you add this check .
Hmm, No response after 13 months 🤔
@tarborali Good thing there's no need for this package then! Just call Swal.fire
in your event handler code. If you were hoping for the popup to be rendered server-side, this package doesn't do that: https://github.com/alex-shamshurin/sweetalert2-react/blob/aaf18ece41be7034937b51508b608cfe6e8e1c7f/src/SweetAlert.js#L281-L283