From a43cb420d56ea6cb775d12733d2d2e35f94d0980 Mon Sep 17 00:00:00 2001 From: Adrian Castro <22133246+castdrian@users.noreply.github.com> Date: Fri, 23 Feb 2024 16:17:57 +0100 Subject: [PATCH] fix: portrait orientation when tabs focused --- apps/expo/src/app/(tabs)/_layout.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/expo/src/app/(tabs)/_layout.tsx b/apps/expo/src/app/(tabs)/_layout.tsx index e346d59..7c8d16e 100644 --- a/apps/expo/src/app/(tabs)/_layout.tsx +++ b/apps/expo/src/app/(tabs)/_layout.tsx @@ -2,6 +2,7 @@ import { useRef } from "react"; import { Platform, View } from "react-native"; import * as Haptics from "expo-haptics"; import { Tabs } from "expo-router"; +import * as ScreenOrientation from "expo-screen-orientation"; import Colors from "@movie-web/tailwind-config/colors"; @@ -29,6 +30,11 @@ export default function TabLayout() { break; } }, + focus: () => { + void ScreenOrientation.lockAsync( + ScreenOrientation.OrientationLock.PORTRAIT_UP, + ); + }, })} screenOptions={{ headerShown: false,