I'm having my screens in a stack navigation and I need to perform an AJAX fetch every time I go to the dashboard screen. I tried using the didComponentMount of the dashboard, but since dashboard is on the top of the stack, it never actually unmounts and mounts. How can I detect, that the user has transitioned to the dahsboard screen? If there was a way where a navigation would sent action to the store every time it navigated somewhere, that would be nice as well....
What should I do?
Edit: I'm using react & redux. And I'm tinkering with this: https://github.com/react-navigation/react-navigation/blob/master/docs/guides/Screen-Tracking.md but I feel there must a better way than modifying the specific navigation. I think there must be a way to just add a middleware or just some code in the given navigation component I want to observe...