Vlad
Vlad

Reputation: 255

Completion block for dismiss light box

Is there way to execute the code right after lightBox has been dismissed? I am looking for an equivalent of completion block:

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

Upvotes: 1

Views: 573

Answers (1)

guy.gc
guy.gc

Reputation: 3501

You can pass a callback in passProps and invoke that callback in componentwillunmount

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

Upvotes: 1

Related Questions