0.0.2 • Published 5 years ago

@rnhooks/accessibility-info v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@rnhooks/accessibility-info Build Status Maintainability

React Native hook for Accessibility Info

Installation

yarn add @rnhooks/accessibility-info

Usage

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>
  );
}

Output

NameTypeDefaultDescription
isScreenReaderEnabledbooleanfalsetrue when the screen reader is enabled and false otherwise