Is this a bug report?
(Yes)
(Yes)
Environment
react-native -v:
react-native-cli: 2.0.1
react-native: 0.47.1
node -v:
npm -v:
yarn --version:
Then, specify:
- Development Operating System: Windows10
- Build tools:
react-native run-android
Steps to Reproduce
(Write your steps here:)
class App extends Component {
componentDidMount() {
BackHandler.addEventListener('hardwareBackPress', this.onBackPress);
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.onBackPress);
}
onBackPress = () => {
return true;
};
render() {
return (
<Text>Press back buton</Text>
);
}
}
If you run the code in development environment , it don't works and when you press back button , app will be closed , but in development environment if you turn on remote debug , the code works well and app not closed
Expected Behavior
(Prevent closing app on back button pressed)
Actual Behavior
(On development environment when remote debug is off it don't woks but when remote debug is on it works)
Reproducible Demo
(N/A)
Is this a bug report?
(Yes)
Have you read the Contributing Guidelines?
(Yes)
Environment
react-native -v:node -v:npm -v:yarn --version:Then, specify:
react-native run-androidSteps to Reproduce
(Write your steps here:)
If you run the code in
developmentenvironment , it don't works and when you press back button , app will be closed , but indevelopmentenvironment if you turn onremote debug, the code works well and app not closedExpected Behavior
(Prevent closing app on back button pressed)
Actual Behavior
(On
developmentenvironment whenremote debugis off it don't woks but whenremote debugis on it works)Reproducible Demo
(N/A)