Skip to main content

useDeviceOS()

The useDeviceOS() hook detects the user's operating system, including mobile emulators, and uses string manipulation for identifying unique or new OS versions.

Import

import { useDeviceOS } from 'react-haiku';

Usage

Loading...

import { useDeviceOS } from 'react-haiku';

export const Component = () => {
const deviceOS = useDeviceOS();

return (
<div>
<b>Check Your Device OS!</b>
<p>OS: {deviceOS}</p>
</div>
);
}