Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1.21 KB

README.md

File metadata and controls

34 lines (24 loc) · 1.21 KB

@rnhooks/device-orientation Build Status Maintainability

React Native hook for device orientation

Demo

Installation

yarn add @rnhooks/device-orientation

Usage

import useDeviceOrientation from '@rnhooks/device-orientation';

function App() {
  const deviceOrientation = useDeviceOrientation();

  return (
    <View style={styles.container}>
      <Text style={styles.type}>Device orientation is:</Text>
      <Text style={styles.effectiveType}>{deviceOrientation}</Text>
    </View>
  );
}

Output

Name Values Description
deviceOrientation portrait, landscape possible values are portrait and landscape