rmariuzzo / react-new-window

🔲 Pop new windows in React, using `window.open`.
https://rmariuzzo.github.io/react-new-window/
MIT License
446 stars 109 forks source link

Fix `onBlock` not being called during a block #121

Open lejara opened 2 years ago

lejara commented 2 years ago

In Firefox, i noticed the script would crash if the this.window is null on line https://github.com/rmariuzzo/react-new-window/blob/d9dbb75f7648e87abc75ea9b0c758be73f375d7a/src/NewWindow.js#L102

and this.setState({ mounted: true }) is set regardless.

This pr fixes this issue which allows onBlock to be called.