react-native-fast-orientation

1.0.0 • Public • Published

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-orientation —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-orientation'
const App = () => {
  const orientation = UseOrientation();
  return (
   // ...
      <View
        style={{
          height: orientation.isPortrait ? 200 : 100,
          width: orientation.isPortrait ? 200 : 100,
          backgroundColor: 'black',
        }}
      />
   // ...
  );
};

export default App;

Package Sidebar

Install

npm i react-native-fast-orientation

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

1.79 kB

Total Files

3

Last publish

Collaborators

  • brijeshnv