用于关闭灯箱的完成块

时间:2017-07-05 19:12:32

标签: react-native react-native-navigation

有没有办法在lightBox被解雇后立即执行代码?我正在寻找相当于完成块:

Navigator.dismissLightBox();
//wait for it to dismiss and execute code

1 个答案:

答案 0 :(得分:1)

您可以在passProps中传递回调并在componentwillunmount

中调用该回调
Navigation.showLightBox({
  screen: "example.LightBoxScreen",
  passProps: {
    onDismiss: () => console.log('dismissed')
  }
});