-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Proposal: Support the Backhandler React Native API on Windows
Summary
React Native has a Backhandler API that detects when the user presses the hardware back button on Android and tvOS devices and calls listeners that subscribe to it. Having support for this in Windows with the various input methods for back navigation (mouse button, Xbox controller B button, etc.) would be useful.
Currently, this API is scaffolded out with empty functions and TODOs, but no open issue is tracking it (the last issue I could find was from the last version of RNW based on .NET).
Motivation
Users expect native Windows app to support mouse back button, and the JS/web APIs for detecting it aren't great, since the browser would normally handle back button behavior. The UWP documentation also recommends that apps implement support for common back inputs.
Basic example
import { BackHandler } from 'react-native';
// ...
BackHandler.addEventListener("hardwareBackPress", this.props.onBackRequested);