npm.io
1.0.1 • Published 7 years ago

react-use-window-size

Licence
MIT
Version
1.0.1
Deps
1
Size
3 kB
Vulns
0
Weekly
0
Stars
1

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

Keywords