0

Is there a possibility that I can force a single View in the entire project to always be in portrait without relying on external dependencies?

I admit that I am new to "React-native" and simply everything I search returns some NPM package to solve the problem.

I cannot accept that such a strong tool has no native resources to solve this type of situation

Obs: I am not using EXPO in this project.

  • Does this answer your question? https://stackoverflow.com/questions/32176548/how-to-disable-rotation-in-react-native – Konstantin Feb 07 '21 at 14:05

1 Answers1

0

You can use react-native-orientation-locker inside the screen you want to rotate for that for example:

import Orientation from 'react-native-orientation-locker';

useEffect(()=>{
    Orientation.lockToLandscape()
},[])
Hassan Kandil
  • 1,612
  • 1
  • 13
  • 26