react-native-fast-orientations
v1.0.0
Published
### In React Native applications, monitor changes in device orientation and programmatically set the preferred orientation for each screen. works on iOS and Android.
Downloads
3
Maintainers
Readme
React Native Orientation
In React Native applications, monitor changes in device orientation and programmatically set the preferred orientation for each screen. works on iOS and Android.
Installation
$ npm install react-native-fast-orientations —save
Usage
Use the Orientation module in your codebase if you want to use the react-native-fast-orientation package :
$ import UseOrientation from 'react-native-fast-orientations'
const App = () => {
const orientation = UseOrientation();
return (
// ...
<View
style={{
height: orientation.isPortrait ? 200 : 100,
width: orientation.isPortrait ? 200 : 100,
backgroundColor: 'black',
}}
/>
// ...
);
};
export default App;