# @alobato/use-mobile-detect

> React hook detect mobile

Latest version **1.0.1** (published 2019-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @alobato/use-mobile-detect
pnpm add @alobato/use-mobile-detect
yarn add @alobato/use-mobile-detect
bun add @alobato/use-mobile-detect
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-08-07 |
| First published | 2019-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | alobato |
| Maintainers | alobato |
| Keywords | react, hooks, fetch |

## Links

- npm: https://www.npmjs.com/package/@alobato/use-mobile-detect
- Repository: https://github.com/alobato/use-mobile-detect
- Homepage: https://github.com/alobato/use-mobile-detect#readme
- Issues: https://github.com/alobato/use-mobile-detect/issues
- npm.io page: https://npm.io/package/@alobato/use-mobile-detect

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-08-07
- 1.0.0 — 2019-08-07

## README

# useMobileDetect

> React hook to add mobile info to body

> **Note:** This is using the new [React Hooks API](https://reactjs.org/docs/hooks-intro.html)
>
> You'll need to install `react`, `react-dom`, etc at `^16.8.0` or above

## Install

```sh
yarn add @alobato/use-mobile-detect
```

## Usage

```js
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>

```

---
_Source: https://npm.io/package/@alobato/use-mobile-detect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
