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(); //ScreenOrientation.unlockAsync();
}, []); }, []);
useEffect(() => { // useEffect(() => {
if (height / width > 1.5) { // if (height / width > 1.5) {
setIsLandscape(false); // setIsLandscape(false);
} // }
if (height / width < 1.5) { // if (height / width < 1.5) {
setIsLandscape(true); // setIsLandscape(true);
} // }
}, [height, width]); // }, [height, width]);
return ( return (
<DeviceOrientationChange.Provider value={{ isLandscape, setIsLandscape }}> <DeviceOrientationChange.Provider value={{ isLandscape, setIsLandscape }}>
{children} {children}