react-mobile-detect

0.1.23 • Public • Published

react-mobile-detect

mobile detect device for react component implement from react-device-detect for my own work

Installation

To install, you can use npm or yarn:

npm i react-mobile-detect
or
yarn add react-mobile-detect

Usage

import {
  BrowserView, // Modify this
  MobileView, // Modify this
  DetectMobileContextProvider
} from "react-mobile-detect";

<BrowserView/>
<MobileView/>

<DetectMobileContextProvider><App/></DetectMobileContextProvider>

const { isMobile } = useMobileDetect();

for Next.js

import dynamic from 'next/dynamic'

const BrowserView = dynamic(() => import('~/components/BrowserView'), { ssr: false })

const MobileView = dynamic(() => import('~/components/MobileView'), { ssr: false })

Run

1. git clone https://github.com/zeing/react-mobile-detect.git

2. yarn

3. yarn start

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.2318latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.2318
0.1.221
0.1.211
0.1.201
0.1.140
0.1.132
0.1.122
0.1.111
0.1.101
0.1.90
0.1.81
0.1.70
0.1.61
0.1.50
0.1.41
0.1.30
0.1.22
0.1.11
0.1.00

Package Sidebar

Install

npm i react-mobile-detect

Weekly Downloads

33

Version

0.1.23

License

none

Unpacked Size

8.78 kB

Total Files

12

Last publish

Collaborators

  • zeing