File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export default () => {
16
16
return ( ) => {
17
17
AppState . removeEventListener ( 'change' , onChange )
18
18
}
19
- } )
19
+ } , [ ] )
20
20
21
21
return appState
22
22
}
Original file line number Diff line number Diff line change @@ -3,15 +3,15 @@ import { Dimensions } from 'react-native';
3
3
4
4
const screen = Dimensions . get ( 'screen' ) ;
5
5
6
+ const isOrientationPortrait = ( { width, height } ) => height >= width ;
7
+ const isOrientationLandscape = ( { width, height } ) => width >= height ;
8
+
6
9
export default ( ) => {
7
10
const [ orientation , setOrientation ] = useState ( {
8
11
portrait : isOrientationPortrait ( screen ) ,
9
12
landscape : isOrientationLandscape ( screen )
10
13
} ) ;
11
14
12
- isOrientationPortrait = ( { width, height } ) => height >= width ;
13
- isOrientationLandscape = ( { width, height } ) => width >= height ;
14
-
15
15
onChange = ( { screen } ) => {
16
16
setOrientation ( {
17
17
portrait : isOrientationPortrait ( screen ) ,
You can’t perform that action at this time.
0 commit comments