1.0.1 • Published 5 years ago

@alobato/use-mobile-detect v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

useMobileDetect

React hook to add mobile info to body

Note: This is using the new React Hooks API

You'll need to install react, react-dom, etc at ^16.8.0 or above

Install

yarn add @alobato/use-mobile-detect

Usage

import useMobileDetect from '@alobato/use-mobile-detect'

export default memo(() => {
  useMobileDetect()
  ...

<Text css={css`body.mobile & { display: none; }`}>Text 1</Text>
<Text css={css`body:not(.mobile) & { display: none; }`}>Text 2</Text>