Close Toast before navigating to other routes



  • Hi everyone, is there a way in manually (forcefully) closing Toast components when you’ve already navigated away from the page that showed or created the Toast component?

    I’d like that Toast message to be hidden automatically when I’ve navigated away from that page.



  • Alert.create() return an object with a dismiss method, so you can do this:

    myAlert = Alert.create('warning!')
    myAlert.dismiss()
    

    I’m not sure if the same can be done with toast