What changed in react-device-detect from 1 to 2
5 releases numbered after v1.15.0 up to and including v2.2.3, stable releases only. v1.15.0 and v2.2.3 are the newest stable releases of 1 and 2 we track; this page follows them as new ones ship.
- 1 mentions breaking changes
- 1 removes or deprecates something
- 2 releases carry a version number we could not place against this range and are not shown; the full changelog has them.
9 changes across 5 releases
- 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
4 releases in the range carry no categorized changes yet: v2.2.3v2.1.2v2.1.1v2.0.1. Their original notes, where the vendor published any, are below.
Original release notes, newest first
The list above is our reading of these notes; the originals from duskload are here, one fold per release.
v2.2.3
v2.1.2
Fix #168
v2.1.1v.2.1.1
Fix #167
v2.0.1v.2.0.1
Icludes #163
v2.0.0
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.