We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I use parcel-bundler instead of webpack. I've tried to do so:
import swal from 'sweetalert'; import SweetAlert from 'sweetalert-react'; // eslint-disable-line import/no-extraneous-dependencies import 'sweetalert/dist/sweetalert.css'; componentDidMount(){ if (typeof(window) == 'undefined') global.window = new Object(); } render(){ return( <div className="ro"> { typeof window !== 'undefined' && ( <SweetAlert show={this.state.show} title="Demo" /> ); }
so in this case I want to render sweet alert only in browser. The problem is this error:
node_modules/sweetalert/lib/modules/utils.js:37 if (window.console) { ^ ReferenceError: window is not defined
doesn't global.window avoid the issue? Thanks
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I use parcel-bundler instead of webpack. I've tried to do so:
so in this case I want to render sweet alert only in browser. The problem is this error:
doesn't global.window avoid the issue?
Thanks
The text was updated successfully, but these errors were encountered: