This wrapper lets you add and remove eventlistener for back button while the considering eventlistener as a global object.
$ npm install react-native-global-back-button
import globalBackHandler from "react-native-global-back-button";
globalBackHandler.disableBackButton();
globalBackHandler.enableBackButton();
If you want to disable the backHandler in one screen and want to enable in another screen you can do import call enableBackButton() in one screen and import and call disableBackButton() in the other screen. Like below.
import globalBackHandler from "react-native-global-back-button";
globalBackHandler.disableBackButton();
import globalBackHandler from "react-native-global-back-button";
globalBackHandler.enableBackButton();