react-new-window
react-new-window copied to clipboard
is there a way to know if the window is closed?
Hi, I want to know if we can pass onClose handler or some alternative so that we can know if the new window is closed or not.
Use case: I want to show a loader in a button and want to stop the loader if an user manually closes the popup
Hi, I want to know if we can pass
onClosehandler or some alternative so that we can know if the new window is closed or not.Use case: I want to show a loader in a button and want to stop the loader if an user manually closes the popup
you'll use onOpen and watch event;
onOpen={e => {
const popupTick = setInterval(() => {
if (e.closed) {
clearInterval(popupTick);
showLoading(false);
}
}, 500);
}}
Thank you so much @ilhantekir! I will try this out