@alobato/use-mobile-detect

1.0.1 • Public • Published

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>

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i @alobato/use-mobile-detect

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

3.18 kB

Total Files

4

Last publish

Collaborators

  • alobato