I’m having an issue where for some reason a mounted of a view that is NOT being showed is being ran.
Picture the following scenario:
- I open the app and get to the homescreen
- I go to a categories page using router.navigate (and mounted is ran)
- I go to home once more (using router.navigate, not a back, a router.navigate)
- From home I go to a certain product
- From the product I go back to the homescreen (Now I am using a back-link button)
And here instead of running the mounted of home (or no mounted at all), it’s trying to run the categories page mounted, and that’s crashing my app, since I use props on the categories page, and they’re undefined when I go back to the homescreen.
Why is the categories’ mounted function being ran if I’m not even accessing it, I believe it’s stuck somewhere in the history, but why a backbutton would trigger the mounted state of a previous page?
Thanks in advance!