1.7.0 • Published 3 years ago

react-device-detector v1.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-device-detector

Bare minimum device detector with no dependecy, Renders components based on device

only 498B gziped

Installing

npm install react-device-detector
yarn add react-device-detector

Usage

import {
  AndroidView,
  IOSView,
  MobileView,
  DesktopView,
} from "react-device-detector";

const MyComponent = () => {
  return (
    <>
      <AndroidView>this will only render on android devices</AndroidView>

      <IOSView>this will only render on iOS devices</IOSView>

      <MobileView>this will only render on mobile</MobileView>

      <DesktopView>this will only render on desktop</DesktopView>
    </>
  );
};

without using components

import { isAndroid, isDesktop, isIOS, isMobile } from "react-device-detector";

const MyComponent = () => {
  if (isMobile) return <p>this will only render on mobile</p>;
  return <p>this will only render on desktop</p>;
};

Contributing

If you have any new suggestions, new features, bug fixes, etc. please contribute by raising pull

1.7.0

3 years ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago