@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>

Readme

Keywords

Package Sidebar

Install

npm i @alobato/use-mobile-detect

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

3.18 kB

Total Files

4

Last publish

Collaborators

  • alobato