react-device-detect

Detect device, and render view according to detected device type.

MIT License

Downloads
4.1M
Stars
2.7K
Committers
31

Bot releases are hidden (Show)

react-device-detect - v2.2.3 Latest Release

Published by duskload over 1 year ago

#205

react-device-detect - v2.1.2

Published by duskload almost 3 years ago

Fix #168

react-device-detect - v.2.1.1

Published by duskload almost 3 years ago

Fix #167

react-device-detect - v.2.0.1

Published by duskload about 3 years ago

Icludes #163

react-device-detect - v2.0.0

Published by duskload about 3 years ago

Package was completely rewritten. But there is not many breaking changes.

Breaking change:

Views doesn't accept viewClassName prop anymore, use className instead.

New type

New type isEmbedded was added, it returns if device type is embedded.

New hooks

useDeviceData and useDeviceSelectors hooks were introduces.

First returns all device data, second returns all available selectors.
Both hooks accept either userAgent as prop, or take it from window.navigator.userAgent.

Enums

BrowserTypes and OsTypes are now exported from the package. They has not very big amount of entries for now, but they will be extended soon.

Utilities updates/additions

Added function getSelectorsByUserAgent which returns all selectors available for given user agent. User agent argument is mandatory.

Now deviceDetect accepts userAgent and returns all available data. Can be used in SSR.

Added function parseUserAgent which returns all available data for given user agent. Useful in SSR. User agent argument is mandatory.

react-device-detect - v1.15.0

Published by duskload almost 4 years ago

Upgrade ua-parser-js version #121
fix withOrientationChange typing + expose useMobileOrientation hook #120
Allow React 17 as peerDependency #113

react-device-detect - v1.14.0

Published by duskload about 4 years ago

Update ua-parser-js

Add isMIUI helper #98
Change isLegacyEdge to be false if isEdgeChromium #111
Make isEdgeChromium work for all operating systems #110

react-device-detect - v.1.13.1

Published by duskload over 4 years ago

Add isLegacyEdge, isEdgeChromium, isWindows, isMacOs types.

Updated isEdgeType to detect both edge and edge chromium

Add fix in case of nav.playtform is undefined #86

react-device-detect - v1.12.1

Published by duskload over 4 years ago

fix isIOS and isMobileSafari on iPads running Safari and iOS #85

react-device-detect - v1.12.0

Published by duskload over 4 years ago

  • Update ua-parser-js
  • Merge fix for ios 13 #81
  • Security fixes
react-device-detect - v1.11.11

Published by duskload almost 5 years ago

Added isElectron

Readme update.

react-device-detect - v.1.10.11

Published by duskload almost 5 years ago

Addressed #55 #56 #57

ua-parser-js update

react-device-detect - v.1.7.5

Published by duskload about 5 years ago

Added new deviceType prop in #35

react-device-detect - v1.6.5

Published by duskload about 5 years ago

  • Improved typesript types support #32
react-device-detect - v.1.6.4

Published by duskload over 5 years ago

Release v1.6.4

  • Swap fullBrowserVersion and browserVersion #29
  • minor fixes