React-native-router-flux: Back button action

Created on 17 May 2017  路  5Comments  路  Source: aksonov/react-native-router-flux

Let us consider screen with Navigation Path as follows:
Scene A > Scene B

From Scene B, pressing Back button '<' will take to Scene A.

  1. Is there any hook available for back button, ie on pressing back button in Scene B, need to access methods in Scene A to change some properties.
  2. Do we have onPress action for back button, so that before going to Scene A, some action need to be perform in Scene B

Most helpful comment

question was asked...issue was closed...no data on solution for original issue... useless forum

All 5 comments

+1

This should work:

onBackFunction()
{
  console.log("backkkkkkkkkk")
  Actions.sceneA()
}


  <Scene key="root" >
          <Scene  key="sceneA" component={SceneA} />
          <Scene  key="sceneB" onBack={this.onBackFunction()} component={SceneB} />
  </Scene>

@Dani93380, I like to pass property from SceneB to SceneA on back button action as like below, but not sure how to call the 'onBackFunction' when I press back button in SceneB

class SceneB extends Component {
    render() {...}

    onBackFunction(){
        Actions.sceneA({myprop:'test'});
    }
}

question was asked...issue was closed...no data on solution for original issue... useless forum

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fgrs picture fgrs  路  3Comments

VictorK1902 picture VictorK1902  路  3Comments

basdvries picture basdvries  路  3Comments

xnog picture xnog  路  3Comments

sreejithr picture sreejithr  路  3Comments