device-probe-react
v2.1.0
Published
React hooks for device-probe
Downloads
177
Maintainers
Readme
@device-probe/react
React hooks for device-probe. See the main README for full documentation.
Installation
npm install device-probe @device-probe/reactUsage
import { useDeviceProbe } from '@device-probe/react'
function MyComponent() {
const { result, isLoading, error } = useDeviceProbe()
if (isLoading) return <div>Loading...</div>
if (error) return <div>Error: {error.message}</div>
return <div>CPU Cores: {result?.performance.cpuCores}</div>
}Hooks
useDeviceProbe(options?)- Probe all device capabilitiesuseScreen()- Screen capabilities onlyusePerformance()- Performance metrics only
All hooks are SSR-safe and will return loading state on the server.
