You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With android:enableOnBackInvokedCallback="true", a minimal bare React Native application does not deliver hardwareBackPress to JavaScript on Android API 35.
The app has one BackHandler listener that logs hardwareBackPress received, increments a visible counter, and returns true.
Observed on a Pixel 8 Pro emulator / Android API 35: pressing the system navigation-bar Back button leaves Back count: 0, emits no hardwareBackPress received log, and returns Android to the home screen.
The reproduction uses React Native 0.87.1.
Control result
Using the same React Native 0.87.1 application and device configuration, with no other source changes, changing only android:enableOnBackInvokedCallback from true to false makes hardwareBackPress reach JavaScript: Back count increments and the app remains visible.
Related reports checked
BackHandler not working on android #51349: closest symptom, but it was reported on unsupported RN 0.75.1 and has no mandatory reproducer. Its enableOnBackInvokedCallback=false result also
differs.
react-native-screens discussion [autodocs] add doc blocks to more things #2540: primarily Fragment Predictive Back support. Later comments mention a different API 36+ BackHandler regression after app
re-foregrounding.
I did not find an exact duplicate for: bare React Native, API 35, target SDK 36, android:enableOnBackInvokedCallback=true, and hardwareBackPress not reaching
JavaScript on the first system navigation-bar Back press.
Expo relevance
Expo's android.predictiveBackGestureEnabled: true maps to android:enableOnBackInvokedCallback=true in the generated Android manifest. This reproduction does not include Expo, so Expo-specific behavior was not tested; however, Expo bare apps using that setting may be affected by the same native configuration.
No stack trace exists. This is not reported as a crash or process termination.
The app registers this listener:
BackHandler.addEventListener('hardwareBackPress', () => {
console.log('hardwareBackPress received');
setBackCount(count => count + 1);
return true;
});
Observed on a Pixel 8 Pro emulator / Android API 35:
- React Native: 0.87.1
- target SDK: 36
- android:enableOnBackInvokedCallback: true
- Input: system navigation-bar Back button
Expected JS log:
hardwareBackPress received
Actual:
No `hardwareBackPress received` log is emitted because the
`hardwareBackPress` listener is not invoked.
`Back count` remains 0 and Android returns to the home screen.
Description
With
android:enableOnBackInvokedCallback="true", a minimal bare React Native application does not deliverhardwareBackPressto JavaScript on Android API 35.The app has one
BackHandlerlistener that logshardwareBackPress received, increments a visible counter, and returnstrue.Observed on a Pixel 8 Pro emulator / Android API 35: pressing the system navigation-bar Back button leaves
Back count: 0, emits nohardwareBackPress receivedlog, and returns Android to the home screen.The reproduction uses React Native 0.87.1.
Control result
Using the same React Native 0.87.1 application and device configuration, with no other source changes, changing only
android:enableOnBackInvokedCallbackfromtruetofalsemakeshardwareBackPressreach JavaScript:Back countincrements and the app remains visible.Related reports checked
enableOnBackInvokedCallback=falseresult alsodiffers.
BackHandlerstops working only after app re-foregrounding on API 36+.react-native-screens; this reproduction excludes Expo, navigation, and Screens.re-foregrounding.
I did not find an exact duplicate for: bare React Native, API 35, target SDK 36,
android:enableOnBackInvokedCallback=true, andhardwareBackPressnot reachingJavaScript on the first system navigation-bar Back press.
Expo relevance
Expo's
android.predictiveBackGestureEnabled: truemaps toandroid:enableOnBackInvokedCallback=truein the generated Android manifest. This reproduction does not include Expo, so Expo-specific behavior was not tested; however, Expo bare apps using that setting may be affected by the same native configuration.Steps to reproduce
Clone https://github.com/DanyKrk/android-backhandler-api35-repro
Install dependencies and start Metro:
In another terminal, build and install the debug APK:
Use a Pixel 8 Pro emulator running Android API 35.
Open the app and press the system navigation-bar Back button.
Expected: hardwareBackPress reaches the listener, Back count increments, and the app remains visible.
Actual: Back count remains 0; no hardwareBackPress received log is emitted; Android returns to the home screen.
React Native Version
0.87.1
Affected Platforms
Runtime - Android, Build - MacOS
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
https://github.com/DanyKrk/android-backhandler-api35-repro
Screenshots and Videos
Screen_recording_20260908_163856.webm