@yunzhoukit/react-native-orientation-locker
v1.5.2
Published
A react-native module that can listen on orientation changing of device, get current orientation, lock to preferred orientation.
Downloads
13
Maintainers
Readme
@yunzhoukit/react-native-orientation-locker
Installation
Using yarn (RN 0.60 and and above)
yarn add @yunzhoukit/react-native-orientation-locker
Using yarn (RN 0.59 and and below)
yarn add @yunzhoukit/react-native-orientation-locker
react-native link @yunzhoukit/react-native-orientation-locker
Manual linking
For Windows, if you are using RNW v0.63.0 or higher, autolinking should link the module for you. Otherwise, you must follow the steps outlined here for linking module.
Add following to MainApplication.java (This will be added automatically by auto link. If not, please manually add the following )
//...
+import org.wonday.orientation.OrientationPackage;
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
+ packages.add(new OrientationPackage());
return packages;
}
//...