Skip to content

Conversation

loderunner
Copy link
Owner

Before the window unloads, use beforeWindowUnload event to unmount the app component. Since unlisten is called in the useLayoutEffect cleanup callback, the debugger will be detached before closing the window, making it possible to reattach when reopening the devtools

@loderunner loderunner requested a review from jvincent42 February 3, 2022 21:48
@loderunner loderunner self-assigned this Feb 3, 2022
@loderunner loderunner force-pushed the fix/unlisten-on-close branch from 81558af to 1fe468a Compare February 3, 2022 22:10
Copy link
Collaborator

@jvincent42 jvincent42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice patch ! TIL

@loderunner loderunner force-pushed the fix/unlisten-on-close branch from 1fe468a to f4cd591 Compare February 4, 2022 08:38
@loderunner loderunner enabled auto-merge (squash) February 4, 2022 08:38
@loderunner loderunner merged commit b3c7488 into main Feb 4, 2022
@loderunner loderunner deleted the fix/unlisten-on-close branch February 4, 2022 08:39
@loderunner
Copy link
Owner Author

🎉 This PR is included in version 0.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants