sweetalert2-react icon indicating copy to clipboard operation
sweetalert2-react copied to clipboard

window is not defined in nextjs

Open yashwant-dangi opened this issue 4 years ago • 2 comments

"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 .

yashwant-dangi avatar Mar 23 '20 10:03 yashwant-dangi

Hmm, No response after 13 months 🤔

tarborlevan avatar Apr 22 '21 08:04 tarborlevan

@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

zenflow avatar Apr 22 '21 12:04 zenflow