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

usebrowserwindowsize

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

usebrowserwindowsize

Simple React hook providing window width and height updates are triggered on window resize event.

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

📐 useBrowserWindowSize

React hook for getting width and height of browser window. Will update on window resize event.

🚀 Getting Started

Usage: useBrowserWindowSize react hook

Add to your project npm i usebrowserwindowsize or using yarn yarn add usebrowserwindowsize.

Simply import the hook to your component.

import useBrowserWindowSize from 'usebrowserwindowsize';

Then you can destruct either width or height (or both) from the hooks return value (Array). Please note that it will be [0, 0] initially.

const [ windowWidth, windowHeight ] = useBrowserWindowSize();

All properties typed as integers.

Keywords

react

FAQs

Package last updated on 22 Sep 2020

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