I want to change the screen orientation to default policy on a specific screen.
Below doesn't set OrientationLock.PORTRAIT_UP when route.name is not ImageModal.
useEffect(() => {
if (route.name === 'ImageModal') {
ScreenOrientation.lockAsync(
ScreenOrientation.OrientationLock.DEFAULT,
);
}
return ScreenOrientation.lockAsync(
ScreenOrientation.OrientationLock.PORTRAIT_UP,
);
});