Enforce that <Touchable*> components only have either the accessibilityRole prop or both accessibilityTraits and accessibilityComponentType props set.
The accessibilityRole props tells VoiceOver on iOS what kind of element the user has selected.
Touchable components are one of:
TouchableOpacity
TouchableHighlight
TouchableWithoutFeedback
TouchableNativeFeedback
TouchableBounce
Touchable
(from react-native-platform-touchable)
- https://reactnative.dev/docs/accessibility#accessibilityrole
- https://reactnative.dev/blog/2018/08/13/react-native-accessibility-updates
This rule takes no arguments.
<TouchableOpacity
accessibilityRole="none"
/>
<TouchableOpacity
accessibilityTraits="none"
accessibilityComponentType="none"
/>
<TouchableOpacity
accessible={false}
/>
<TouchableOpacity />
<TouchableOpacity accessibilityComponentType="none" />
<TouchableOpacity
accessibilityTraits="none"
/>
<TouchableOpacity accessibilityRole="none" accessibilityComponentType="none" />
<TouchableOpacity accessibilityRole="none" accessibilityTraits="none" />
<TouchableOpacity accessibilityRole="none" accessibilityComponentType="none" accessibilityTraits="none" />