I am trying to handle back button into the mobile app. I am getting some error again and again whenever I try to go back into my app screens. My code is as under : -
BackHandler.addEventListener("hardwareBackPress", () => {
if (this.navigator && this.navigator.getCurrentRoutes().length > 1) {
this.navigator.pop()
return true // do not exit app
} else {
return false // exit app
}
})
Note : - I'm using react native version 0.44.2.
Any help would be appriciated.
Thanks
via MaMalik
No comments:
Post a Comment