campsy-device-detection
v1.0.0
Published
Mobile Detection
Downloads
3
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>
}