react native detect ipad

Solutions on MaxInterview for react native detect ipad by the best coders in the world

showing results for - "react native detect ipad"
Donovan
02 Jul 2018
1If you do not want to use any new package then use this
2
3
4import { Dimensions } from 'react-native';
5const {height, width} = Dimensions.get('window'); 
6const aspectRatio = height/width;
7
8if(aspectRatio>1.6) {
9
10   // Code for Iphone
11
12}
13else {
14
15   // Code for Ipad
16
17}
18
19this work fine for me
20
21