How can I give a custom navigation to the header back arrow in ReactNavigation? I want the back arrow in the header to navigate to the screen I define and not to the previous screen.
Thanks.
How can I give a custom navigation to the header back arrow in ReactNavigation? I want the back arrow in the header to navigate to the screen I define and not to the previous screen.
Thanks.
You could try 2 things:
a) use
headerMode: 'none'
in yoursub-StackRouters
instead of your root router (named RouterComponent). Ideally you shouldn't have to do anything more then and the headers of thesub-StackRouters
would be displayed in your root router's header. I think I remember something similarly worked a while back for me, but I haven't tested it in a while now and I think it's unlikely that it will still work like this but you can test nevertheless.b) and this is what I'm currently using in a different situation. To manually include the back button:
If above solution doesn't work,
Try to add navigationOptions directly to the ProfileStack definition.