react-use-window-size
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

useWindowSize - Custom React Hook

A custom React Hook to get the window dimensions including resizing.

Useful for implementing responsive behavior, modifying elements for different screen sizes.

Install

$ npm install react-use-window-size

Usage

import useWindowSize from './useWindowSize';
 
const { width, height } = useWindowSize();
 
console.log(width, height); //Current window size i.e. 1366 768

License

MIT

Package Sidebar

Install

npm i react-use-window-size

Weekly Downloads

244

Version

1.0.1

License

MIT

Unpacked Size

2.87 kB

Total Files

5

Last publish

Collaborators

  • danielkhoo