To prevent rotation of screen with React Native, we can use the orientation field in your app.json file if our app is built with Expo.
For example, we write
{
"expo": {
"name": "My app",
"slug": "my-app",
"sdkVersion": "21.0.0",
"privacy": "public",
"orientation": "portrait"
}
}
to set the orientation
to portrait
.