Files
cally/components/pages/(tablet_pages)/chores/TabletChoresPage.tsx
2024-11-03 18:39:32 +01:00

28 lines
731 B
TypeScript

import React, { useEffect } from 'react';
import { View, Text } from 'react-native';
import * as ScreenOrientation from 'expo-screen-orientation';
const TabletChoresPage = () => {
// Function to lock the screen orientation to landscape
const lockScreenOrientation = async () => {
await ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.LANDSCAPE_RIGHT);
};
useEffect(() => {
lockScreenOrientation(); // Lock orientation when the component mounts
return () => {
// Optional: Unlock to default when the component unmounts
ScreenOrientation.unlockAsync();
};
}, []);
return (
<View>
<Text>TabletChoresPage</Text>
</View>
);
};
export default TabletChoresPage;