> For the complete documentation index, see [llms.txt](https://bamtech.gitbook.io/dev-standards/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bamtech.gitbook.io/dev-standards/react-native/features/lock-device-orientation.mo.md).

# lock-device-orientation.mo

## Owner: [Kévin Jean](https://github.com/Miniplop)

## Prerequisites

* A running React Native app, preferably started with the generator

## Steps

* Follow [this](https://github.com/yamill/react-native-orientation/blob/master/README.md) to install react-native-orientation

> :warning: Do not forget to rebuild your app

### Lock all the app pages

> :warning: Do not lock the screen rotation on react-native-camera or other native modules which needs screen rotation

We need to lock all the app pages, to do so import react-native-orientation in our top component:

`import Orientation from 'react-native-orientation`

Add those lines to lock the orientation:

```
componentWillMount () {
  Orientation.lockToPortrait()
}
```

* Refresh your app, and try to rotate your screen
* [Star the repo](https://github.com/yamill/react-native-orientation) if it works ;)
