0.0.2 • Published 5 years ago
@rnhooks/device-orientation v0.0.2
@rnhooks/device-orientation

React Native hook for device orientation
Installation
yarn add @rnhooks/device-orientationUsage
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 |