Add unsubscribe() to preventing-going-back example
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.
Feel free to review the changes and let me know if there are any questions or feedback. Thanks! 😊
Deploy Preview for react-navigation-docs ready!
| Name | Link |
|---|---|
| Latest commit | 7839cff38bc718b08762b3b65bb067adf01e6ddf |
| 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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.