Skip to content

Commit 06f1bef

Browse files
author
Unicar
committed
Added screen-height-width.md
1 parent 38ecb46 commit 06f1bef

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
To access a screen height and width in `React Native`, import `Dimension`.
2+
3+
Code:
4+
```React
5+
6+
import { Dimensions } from 'react-native'
7+
8+
const SCREEN_WIDTH = Dimensions.get('window').width
9+
const SCREEN_HEIGHT = Dimensions.get('window').height
10+
11+
```
12+

0 commit comments

Comments
 (0)