New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-hook-screen-orientation

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hook-screen-orientation

React hook for accessing screen orientation

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
229
18.65%
Maintainers
1
Weekly downloads
 
Created
Source

react-hook-screen-orientation :arrows_clockwise:

A React hook for detecting screen orientation.

Installation

Using npm:

npm install --save react-hook-screen-orientation

Using yarn:

yarn add react-hook-screen-orientation

Usage

import React from 'react'
import useScreenOrientation from 'react-hook-screen-orientation'

const ComponentWithScreenOrientation = () => {
  const screenOrientation = useScreenOrientation()

  return (
    <p>Screen orientation is: {screenOrientation}</p>
  )
}

Notes

The screenOrientation value provided by the hook is the type propery of a ScreenOrientation interface is always one of the following strings:

  • portrait-primary
  • portrait-secondary (meaning upside down)
  • landscape-primary
  • landscape-secondary (meaning upside down)

Contributions

Contributions are welcome. File bug reports, create pull requests, feel free to reach out at tothab@gmail.com.

Licence

LGPL-3.0

Keywords

react

FAQs

Package last updated on 20 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts