Skip to content

Intercept Navigation.pop() #1749

Closed
Closed
@mykelaballe

Description

@mykelaballe

Is there a way to intercept the Navigation.pop() and add a conditional statement whether to continue the pop or cancel it? Already tried this:

componentWillUnmount(){
return false
}

Version

Tell us which versions you are using:

  • react-native-router-flux v3.35.0
  • react-native v0.34.0

Expected behaviour

When navigating to a screen where you can edit some data, then going back to previous screen without hitting the "Save" button, the app should be able to detect that there are changes made and ask the user whether to discard the changes or cancel the navigation back to previous screen

Actual behaviour

I have no way of intercepting the Navigation.pop() and instead it will just go to previous screen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions