File tree Expand file tree Collapse file tree 4 files changed +8
-1
lines changed
Expand file tree Collapse file tree 4 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ const styles = {
117117| isMobile | bool | returns true if device type is ` mobile ` or ` tablet ` |
118118| isMobileOnly | bool | returns true if device type is ` mobile ` |
119119| isTablet | bool | returns true if device type is ` tablet ` |
120- | isBrowser | bool | returns true if device type is ` browser ` |
120+ | isBrowser (legacy) | bool | returns true if device type is ` browser ` (better to use ` isDesktop ` instead) |
121+ | isDesktop | bool | returns true if device type is ` browser ` (an alias of the isBrowser type |
121122| isSmartTV | bool | returns true if device type is ` smarttv ` |
122123| isWearable | bool | returns true if device type is ` wearable ` |
123124| isConsole | bool | returns true if device type is ` console ` |
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ declare module "react-device-detect" {
2121 export import CustomViewProps = ReactDeviceDetect . CustomViewProps ;
2222 export import ViewProps = ReactDeviceDetect . ViewProps ;
2323 export import isBrowser = ReactDeviceDetect . isBrowser ;
24+ export import isDesktop = ReactDeviceDetect . isDesktop ;
2425 export import isMobile = ReactDeviceDetect . isMobile ;
2526 export import isTablet = ReactDeviceDetect . isTablet ;
2627 export import isSmartTV = ReactDeviceDetect . isSmartTV ;
@@ -124,6 +125,8 @@ declare namespace ReactDeviceDetect {
124125
125126 export const isBrowser : boolean ;
126127
128+ export const isDesktop : boolean ;
129+
127130 export const isMobile : boolean ;
128131
129132 export const isTablet : boolean ;
Original file line number Diff line number Diff line change @@ -557,6 +557,7 @@ var isMobile = isMobileAndTabletType() || getIPad13();
557557var isMobileOnly = isMobileType ( ) ;
558558var isTablet = isTabletType ( ) || getIPad13 ( ) ;
559559var isBrowser = isBrowserType ( ) ;
560+ var isDesktop = isBrowserType ( ) ;
560561var isAndroid = isAndroidType ( ) ;
561562var isWinPhone = isWinPhoneType ( ) ;
562563var isIOS = isIOSType ( ) || getIPad13 ( ) ;
@@ -840,6 +841,7 @@ exports.isBrowser = isBrowser;
840841exports . isChrome = isChrome ;
841842exports . isChromium = isChromium ;
842843exports . isConsole = isConsole ;
844+ exports . isDesktop = isDesktop ;
843845exports . isEdge = isEdge ;
844846exports . isEdgeChromium = isEdgeChromium ;
845847exports . isElectron = isElectron ;
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ export const isMobile = isMobileAndTabletType() || getIPad13();
7878export const isMobileOnly = isMobileType ( ) ;
7979export const isTablet = isTabletType ( ) || getIPad13 ( ) ;
8080export const isBrowser = isBrowserType ( ) ;
81+ export const isDesktop = isBrowserType ( ) ;
8182export const isAndroid = isAndroidType ( ) ;
8283export const isWinPhone = isWinPhoneType ( ) ;
8384export const isIOS = isIOSType ( ) || getIPad13 ( ) ;
You can’t perform that action at this time.
0 commit comments