All Projects → antonybudianto → react-ua

antonybudianto / react-ua

Licence: MIT license
📱React User Agent Component, Hook, and HOC. SSR-ready, full UT, using new React Context and Hooks API

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-ua

user-agent
User-Agent parser for Clojure
Stars: ✭ 24 (+33.33%)
Mutual labels:  user-agent, user-agent-parser
uainfer
Infer the user agent from its User Agent string
Stars: ✭ 21 (+16.67%)
Mutual labels:  user-agent, user-agent-parser
Ua Parser Js
UAParser.js - Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment.
Stars: ✭ 6,421 (+35572.22%)
Mutual labels:  user-agent, user-agent-parser
php-useragent
A User-agent analyze project which written by PHP.
Stars: ✭ 83 (+361.11%)
Mutual labels:  user-agent
react-ui-hooks
🧩Simple repository of React hooks for building UI components
Stars: ✭ 20 (+11.11%)
Mutual labels:  hooks
uni-design
基于React hooks的一套基础组件
Stars: ✭ 22 (+22.22%)
Mutual labels:  hooks
use-images-loaded
🖼️ Returns true once all the images inside a container are loaded
Stars: ✭ 82 (+355.56%)
Mutual labels:  hooks
Vytal
Browser extension to spoof timezone, geolocation, locale and user agent.
Stars: ✭ 1,449 (+7950%)
Mutual labels:  user-agent
pyinstaller-hooks-contrib
Community maintained hooks for PyInstaller.
Stars: ✭ 66 (+266.67%)
Mutual labels:  hooks
dobux
🍃 Lightweight responsive state management solution.
Stars: ✭ 75 (+316.67%)
Mutual labels:  hooks
react-useForm
World's simplest React hook to manage form state
Stars: ✭ 30 (+66.67%)
Mutual labels:  hooks
on-outside-click-hook
A React custom hook to detect clicks which triggers outside the element and then fire an event.
Stars: ✭ 17 (-5.56%)
Mutual labels:  hooks
use-google-autocomplete
A simple React Hook API that returns Google Autocomplete results with session_token handling.
Stars: ✭ 27 (+50%)
Mutual labels:  hooks
framer-motion-hooks
Fill the hook gap in Framer Motion
Stars: ✭ 160 (+788.89%)
Mutual labels:  hooks
use-latest
No description or website provided.
Stars: ✭ 18 (+0%)
Mutual labels:  hooks
crypto-watchdog
Crypto Watchdog is an open-source developer friendly project, periodically queries crypto market and notifies potential pumps & recently added tokens/coins via web-hooks.
Stars: ✭ 22 (+22.22%)
Mutual labels:  hooks
browserslist-generator
A library that makes generating and validating Browserslists a breeze!
Stars: ✭ 77 (+327.78%)
Mutual labels:  user-agent
react-hooks-form
React Forms the Hooks Way
Stars: ✭ 25 (+38.89%)
Mutual labels:  hooks
uach-retrofill
This snippet illustrates how to reconstruct the legacy navigator.userAgent string value from the modern navigator.userAgentData values.
Stars: ✭ 26 (+44.44%)
Mutual labels:  user-agent
useCustomHooks
📦 npm package containing a set of custom hooks for your next React project.
Stars: ✭ 12 (-33.33%)
Mutual labels:  hooks

react-ua

npm version Build Status

React User Agent Component and Provider, SSR-ready, using new React Context API

Requirement

  • React 16.8.0

Features

Try it live at StackBlitz

import React from 'react';
import { UserAgentProvider, useUserAgent } from 'react-ua';

const CompWithHooks = () => {
  const ua = useUserAgent();
  return <div>OS: {ua.os.name}</div>;
};

const CompWithHoc = withUserAgent(({ ua }) => <div>OS: {ua.os.name}</div>);

const App = () => (
  <UserAgentProvider>
    <CompWithHoc />
    <CompWithHooks />
  </UserAgentProvider>
);

ReactDOM.render(<App />, document.getElementById('#root'));

// SSR
const el = (
  <UserAgentProvider value={request.headers['user-agent']}>
    <Comp />
    <CompWithHoc />
  </UserAgentProvider>
);

ReactDOMServer.renderToString(el);

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].