0

I use React-native and Stack-navigator to navigate between screen. When I go for the Screen1 to the screen2, I would like to use the native button (back in android, I don't know how int called) but it killed the app instead of going back.

this is an example of my code using stack Navigator

const NewUser = new StackNavigator(

{
    Step1: {screen: Step1},
    Step2: {screen: Step2},
    Assistant: {screen: Assistant}
  },
  {
    initialRouteName: "Step1",
    headerMode: "none"
  }
);

and there, I go to the step2 using

this.props.navigation.navigate("Step2", { name: this.state.value })

if the user have some error (or want to go back for some reason) I want to return to the step1 using the android native back button

It doesn't work from me, it kills my app

0 Answers0