@rnhooks/device-orientation

0.0.2 • Public • Published

@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

Package Sidebar

Install

npm i @rnhooks/device-orientation

Weekly Downloads

572

Version

0.0.2

License

MIT

Unpacked Size

17.2 kB

Total Files

11

Last publish

Collaborators

  • pritishvaidya
  • divyanshu013