Skip to content

Conversation

@kulak91
Copy link

@kulak91 kulak91 commented Aug 11, 2023

Hi there! 👋
I've added the unsubscribe() method to the "preventing-going-back" example. This addition ensures that we clean up the event listener when the component unmounts, preventing potential memory leaks and bugs.

The unsubscribe() method is called when the component is unmounted, which removes the listener set up for the beforeRemove event. This is important for maintaining a clean and efficient navigation flow by avoiding unnecessary event listeners stacking after the component is no longer in use.

image

Feel free to review the changes and let me know if there are any questions or feedback. Thanks! 😊

@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for react-navigation-docs ready!

Name Link
🔨 Latest commit 7839cff
🔍 Latest deploy log https://app.netlify.com/sites/react-navigation-docs/deploys/64d5fdea640c7a0008d9cd90
😎 Deploy Preview https://deploy-preview-1269--react-navigation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant