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

react-hook-viewport-size

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hook-viewport-size

React hook for accessing viewport size

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

react-hook-viewport-size :straight_ruler:

A React hook for detecting viewport size.

Installation

Using npm:

npm install --save react-hook-viewport-size

Using yarn:

yarn add react-hook-viewport-size

Usage

import React from 'react'
import useViewportSize from 'react-hook-viewport-size'

const ComponentWithViewportSize = () => {
  const [viewportWidth, viewportHeight] = useViewportSize()

  return (
    <p>Viewport size: {viewportWidth} × {viewportHeight}</p>
  )
}

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 21 Nov 2021

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