My react-native application (on Android) does not shut down when back button is pressed. It closes and goes in the background and runs there (animates).
I also tried this, but got the same outcome:
BackHandler.addEventListener('hardwareBackPress', () => {
console.log('back pressed');
BackHandler.exitApp();
});
I want it to completely shut down when I press back or home button.
P.S. I'm using Expo for development and deployment, and also start the app through it.
componentDidMount()method ? - Rizal SidikBackHandlerinsidecomponentDidMount()method, i can solve my problem, but it's oke if you want to use that package - Rizal Sidik