2

I'm having some problem with React Navigation.

I have a tab navigator with different tabs, one of them being a StackNavigator. Some times I wan't to navigate from Tab1 to some screen (let say A) in the StackNavigator I wan't some action to go back to Tab1 from the A screen in the StackNavigator.

I was able to find this action dispatching a. navigate action.

But I'm unable to have a "back" transition from A to Tab1

Many thanks for your help.

Regards, David

1 Answer 1

0

Add the following in your "Screen A"

static navigationOptions = ({navigation}) => ({
    headerLeft: <HeaderBackButton onPress={() => navigation.goBack(null)}/>,
    backBehavior: 'initialRoute'
});

Don't forget to import HeaderBackButton:

import {HeaderBackButton} from 'react-navigation';

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.