React Native hook for Accessibility Info
yarn add @rnhooks/accessibility-info
import useAccessibilityInfo from '@rnhooks/accessibility-info';
function App() {
const isScreenReaderEnabled = useAccessibilityInfo();
return (
<View style={styles.container}>
<Text style={styles.type}>Screen reader is:</Text>
<Text style={styles.effectiveType}>
{isScreenReaderEnabled ? 'on' : 'off'}
</Text>
</View>
);
}
Name | Type | Default | Description |
---|---|---|---|
isScreenReaderEnabled | boolean | false |
true when the screen reader is enabled and false otherwise |