useDevice
Detects device type and returns a boolean for each detected type.
useDevice
Installation
Usage
API
useDevice
Returns a boolean value for each device type.
Returns
| Name | Type | Description |
|---|---|---|
| isMobile | boolean | A boolean value indicating whether the device is a mobile device. |
| isDesktop | boolean | A boolean value indicating whether the device is a desktop device. |
| isTablet | boolean | A boolean value indicating whether the device is a tablet device. |
| DesktopView | () => void | A function that toggles the visibility of the desktop view. |
| MobileView | () => void | A function that toggles the visibility of the mobile view. |
| TabletView | () => void | A function that toggles the visibility of the tablet view. |