I am using react-navigation for my application and I have a navigation stack like this:
Home > Open > View
I would like to go back from View to Home, but I am having some difficulty with the navigation.goBack() function. Basically, this is what I have so far:
navigation.goBack('Home');
What I have found out so far is that the goBack function takes a parameter 'key' which in the docs seems like the routeName, however on closer inspection on my console I can see that the key for my 'Home' page is not the same as the routeName.
My question is how can I find the corresponding 'key' to my 'Home' page? The weird thing is I can see it actually everytime I load a page because the react-navigation prints 'Navigation Dispatch' to the console with all of its properties, I just am not sure how to access these items.
Any help would be greatly appreciated thanks!