- If one subscription returns true, then subscriptions registered earlier will not be called.
- If no subscription returns true or none are registered, it programmatically invokes the default back button functionality to exit the app.
Pattern
Example
The following example implements a scenario where you confirm if the user wants to exit the app:BackHandler.addEventListener creates an event listener & returns a NativeEventSubscription object which should be cleared using NativeEventSubscription.remove method.
Usage with React Navigation
If you are using React Navigation to navigate across different screens, you can follow their guide on Custom Android back button behaviourBackhandler hook
React Native Hooks has a niceuseBackHandler hook which will simplify the process of setting up event listeners.

