JSPM

campsy-device-detection

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q20231F
  • License ISC

Mobile Detection

Package Exports

  • campsy-device-detection

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (campsy-device-detection) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Node Package

This is a simple node package that can be used in any solution by importing and calling the variables.

Installation

    npm install campsy-device-detection

Usage

    // import the class into the component
    import {mobileDevice} from "campsy-device-detection"

    // Render what is returned
    <h1>Value: {JSON.stringify(mobileDevice)}</h1>

    // Use it for conditionally rendering, React Example
    const NewComponent = () => {
        <React.Fragment>
            <h1>The H2 tag below will only render based on the condition!</h1>
            {mobileDevice && <h2>This will render if mobileDevice is true</h2>}
        </React.Fragment>
    }