Back button behavior is correct for the platform
Why it matters
Broken back-button behavior is the most reliably reported UX defect in mobile app reviews. On Android, a hardware back press that skips a screen, crashes the app, or silently does nothing fails WCAG 2.2 SC 2.1.1 (Keyboard), which requires keyboard-equivalent navigation for all functionality. Beyond accessibility compliance, unexpected back behavior corrupts navigation state in ways that can strand users mid-flow — stranded on a checkout confirmation with no path to their cart, or dropped to an empty stack with no way to recover.
Severity rationale
High because incorrect back-button behavior corrupts navigation state for all Android users and constitutes a keyboard accessibility failure under WCAG 2.2 SC 2.1.1, blocking users who rely on hardware navigation.
Remediation
React Navigation handles the default back behavior automatically for most stack setups — only intervene when you need to intercept it (e.g., unsaved-form confirmation). Use useFocusEffect with BackHandler to manage the Android hardware back button on screens that need custom logic:
import { useFocusEffect } from '@react-navigation/native'
import { BackHandler, Alert } from 'react-native'
function EditFormScreen({ navigation }) {
const [isDirty, setIsDirty] = React.useState(false)
useFocusEffect(
React.useCallback(() => {
const onBackPress = () => {
if (isDirty) {
Alert.alert('Discard changes?', '', [
{ text: 'Cancel', onPress: () => null },
{ text: 'Discard', onPress: () => navigation.goBack() },
])
return true // prevent default
}
return false // use default
}
BackHandler.addEventListener('hardwareBackPress', onBackPress)
return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress)
}, [isDirty, navigation])
)
}
For screens without custom needs, do not add a BackHandler at all — letting React Navigation's default behavior run is correct.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Mobile Navigation & Deep Linking Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- wcag:2.2 · 2.1.1 — Keyboard
Taxons
History
- 2026-04-18·v1.0.0·Initial import from mobile-navigation-linking·automated