0.0.2 • Published 3 years ago

@rnhooks/device-orientation v0.0.2

Weekly downloads
736
License
MIT
Repository
github
Last release
3 years ago

@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

NameValuesDescription
deviceOrientationportrait, landscapepossible values are portrait and landscape