README
:package: use-os
Parses browser user-agent strings for React
Did you like the project? Please, considerate being a supporter and receive exclusive gifts!
Installation
Clone this repository:
git clone https://github.com/hebertcisco/use-os
Open the directory and install the dependencies
cd use-os
npm install
Using
import useOs from "use-os";
In react component:
export default function HomePage() {
const os = useOs();
return (
<div>
{os === "windows" ? (
<>
<b>Windows</b> (.exe)
</>
) : (
<></>
)}
</div>
);
}