This commit is contained in:
harukin-expo-dev-env 2024-04-05 16:06:10 +00:00
parent c3ce82f978
commit c9ebec0837

View File

@ -22,14 +22,14 @@ export const DeviceOrientationChangeProvider = ({ children }) => {
//ScreenOrientation.unlockAsync();
}, []);
useEffect(() => {
if (height / width > 1.5) {
setIsLandscape(false);
}
if (height / width < 1.5) {
setIsLandscape(true);
}
}, [height, width]);
// useEffect(() => {
// if (height / width > 1.5) {
// setIsLandscape(false);
// }
// if (height / width < 1.5) {
// setIsLandscape(true);
// }
// }, [height, width]);
return (
<DeviceOrientationChange.Provider value={{ isLandscape, setIsLandscape }}>
{children}