#205
react-device-detect
Frameworks & LibrariesDetects device type and browser to branch rendering in React.
Changelog
Fix #168
v.2.1.1
Fix #167
v.2.0.1
Icludes #163
- Add new type isEmbedded that returns if device type is embedded
- Add useDeviceData hook that returns all device data and accepts optional userAgent prop or uses window.navigator.userAgent
- Add useDeviceSelectors hook that returns all available selectors and accepts optional userAgent prop or uses window.navigator.userAgent
- Export BrowserTypes and OsTypes enums from the package
- Add getSelectorsByUserAgent function that returns all selectors available for a given user agent
- Add parseUserAgent function that returns all available data for a given user agent, useful in SSR
- Package was completely rewritten
- deviceDetect now accepts userAgent parameter and returns all available data for use in SSR
- Views no longer accept viewClassName prop, use className instead
From react-device-detect
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.
- Expose useMobileOrientation hook
- Upgrade ua-parser-js version
- Allow React 17 as peerDependency
- Fix withOrientationChange typing
From react-device-detect
Upgrade ua-parser-js version #121 fix withOrientationChange typing + expose useMobileOrientation hook #120 Allow React 17 as peerDependency #113
v1.14.0
- Add isMIUI helper
- Update ua-parser-js
- Change isLegacyEdge to be false if isEdgeChromium
- Make isEdgeChromium work for all operating systems
From react-device-detect
Update ua-parser-js
Add isMIUI helper #98 Change isLegacyEdge to be false if isEdgeChromium #111 Make isEdgeChromium work for all operating systems #110
v.1.13.1
- Add isLegacyEdge, isEdgeChromium, isWindows, and isMacOs types
- Update isEdgeType to detect both edge and edge chromium
- Add fix in case of nav.platform is undefined
From react-device-detect
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
v1.12.1
fix isIOS and isMobileSafari on iPads running Safari and iOS #85
- Update
ua-parser-js - Merge fix for ios 13 #81
- Security fixes
More in Frameworks & Libraries
View allThe library for web and native user interfaces.
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
The progressive JavaScript framework for building user interfaces.
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
Bring data to life with SVG, Canvas and HTML.
Framework for building cross-platform desktop apps with Chromium and Node.js.
Discussion
If you publish react-device-detect, you can claim this product by proving you administer its repository.