How to use the mobile-detect/mobile-detect function in mobile-detect

To help you get started, we’ve selected a few mobile-detect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github slidewiki / slidewiki-platform / components / Deck / ContentPanel / DeckModes / DeckViewPanel / DeckViewPanel.js View on Github external
componentDidMount() {
        let userAgent = window.navigator.userAgent;
        let mobile = new MobileDetect(userAgent);
        this.setState({isMobile: (mobile.phone() !== null) ? true : false});
    }

mobile-detect

Device detection (phone, tablet, desktop, mobile grade, os, versions)

MIT
Latest version published 4 years ago

Package Health Score

58 / 100
Full package analysis