campsy-device-detection
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i campsy-device-detection

Weekly Downloads

12

Version

1.0.0

License

ISC

Unpacked Size

1.95 kB

Total Files

4

Last publish

Collaborators

  • gcamps