JaSHin
JaSHin

Reputation: 277

React Navigation - default goBack button not working

I created simple StackNavigator

export const AppNavigator = StackNavigator({
    Conversations: {screen: ConversationsContainer},
    Chat: {screen: Chat}
}, {
    navigationOptions: {
        headerTintColor: "#36c3e7"
    },
})

and when I navigate from conversations to chat and I tried to press go back button then application crashed with error _this.props.navigation.goBack is not a function but when I use back gesture on iOS simulator it works.

Upvotes: 2

Views: 1062

Answers (1)

Tebogo Mahlalela
Tebogo Mahlalela

Reputation: 265

With my case I had this issue with react-native-navigation v5. To fix this I did this:

  1. I've added the following on android/app/build.gradle under dependencies

    implementation "androidx.appcompat:appcompat:1.1.0-rc01" implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02"

  2. wiped the emulator by emulator -avd <device_name> -wipe-data

  3. cd android && gradle clean
  4. react-native run-android

Upvotes: 1

Related Questions