# react-device-detect v2.0.0 - Product: react-device-detect (https://whatsnew.fyi/product/react-device-detect) - Vendor: duskload - Date: 2021-09-27 - Version: v2.0.0 - Original notes: https://github.com/duskload/react-device-detect/releases/tag/v2.0.0 - Permalink: https://whatsnew.fyi/product/react-device-detect/releases/v2.0.0 What's New is an index, not a publisher: every entry below links to the vendor's own release notes, which are the authoritative source. Entries are labelled where they are hand-curated sample data, pre-releases, or drawn from a secondary source such as a developer blog. Reuse: the summaries, labels and curation here are © What's New. Quote freely with attribution and a link back; wholesale republication of the corpus is not permitted — terms: https://whatsnew.fyi/terms. The vendors' own release notes remain their publishers'. --- - **changed** — Package was completely rewritten - **removed** — Views no longer accept viewClassName prop, use className instead - **added** — Add new type isEmbedded that returns if device type is embedded - **added** — Add useDeviceData hook that returns all device data and accepts optional userAgent prop or uses window.navigator.userAgent - **added** — Add useDeviceSelectors hook that returns all available selectors and accepts optional userAgent prop or uses window.navigator.userAgent - **added** — Export BrowserTypes and OsTypes enums from the package - **added** — Add getSelectorsByUserAgent function that returns all selectors available for a given user agent - **changed** — deviceDetect now accepts userAgent parameter and returns all available data for use in SSR - **added** — Add parseUserAgent function that returns all available data for a given user agent, useful in SSR 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.