We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9c229ff + 323be37 commit 4eadb24Copy full SHA for 4eadb24
lib/useDeviceOrientation.js
@@ -3,15 +3,15 @@ import { Dimensions } from 'react-native';
3
4
const screen = Dimensions.get('screen');
5
6
+const isOrientationPortrait = ({ width, height }) => height >= width;
7
+const isOrientationLandscape = ({ width, height }) => width >= height;
8
+
9
export default () => {
10
const [orientation, setOrientation] = useState({
11
portrait: isOrientationPortrait(screen),
12
landscape: isOrientationLandscape(screen)
13
});
14
- isOrientationPortrait = ({ width, height }) => height >= width;
- isOrientationLandscape = ({ width, height }) => width >= height;
-
15
onChange = ({ screen }) => {
16
setOrientation({
17
0 commit comments