Socket
Socket
Sign inDemoInstall

react-use-window-sizes

Package Overview
Dependencies
5
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

4

index.js
import { useState, useLayoutEffect } from "react";
const useWindowSize = () => {
const useWindowSizes = () => {
const [windowSize, setWindowSize] = useState({ width: 0, height: 0 });

@@ -20,2 +20,2 @@

export { useWindowSize };
export { useWindowSizes };
{
"name": "react-use-window-sizes",
"version": "1.0.0",
"version": "1.0.1",
"description": "A lightweight package to easily track window size in React.js",

@@ -11,3 +11,3 @@ "main": "index.js",

"type": "git",
"url": "git+https://github.com/hxf31891/react-use-window-size.git"
"url": "git+https://github.com/hxf31891/react-use-window-sizes.git"
},

@@ -34,5 +34,5 @@ "keywords": [

"bugs": {
"url": "https://github.com/hxf31891/react-use-window-size/issues"
"url": "https://github.com/hxf31891/react-use-window-sizes/issues"
},
"homepage": "https://github.com/hxf31891/react-use-window-size#readme",
"homepage": "https://github.com/hxf31891/react-use-window-sizes#readme",
"publishConfig": {

@@ -39,0 +39,0 @@ "@hxf31891:registry": "https://npm.pkg.github.com"

@@ -1,2 +0,19 @@

# react-use-window-size
A lightweight package to easily track window size in React.js
# useWindowSizes - a custom React hook
A lightweight package to easily track window width & height in React.js
Comes in handy for responsize design and animations
## Install
`npm install react-use-window-sizes`
## Example
```js
import React from 'react'
import { useWindowSizes } from 'react-use-window-sizes'
function MyApp() {
const { width, height } = useWindowSizes();
console.log('width:', width, 'height:', height)
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc