0.1.4 • Published 5 years ago
@banterstudiosuk/use-window-resize v0.1.4
@banterstudiosuk/use-window-resize
React hook to monitor and retrieve the window size
Note: This is using the new React Hooks API Proposal which is subject to change until React 16.7 final.
You'll need to install
react
,react-dom
at^16.7.0-alpha.0
Install
npm
npm i --save @banterstudiosuk/use-window-resize
Usage
import useWindowResize from '@banterstudiosuk/use-window-resize'
const SomeComponent = () => {
const {
innerWidth,
innerHeight,
outerWidth,
outerHeight
} = useWindowResize()
return (
<code>
innerWidth: {innerWidth}
innerHeight: {innerHeight}
outerWidth: {outerWidth}
outerHeight: {outerHeight}
</code>
)
}
License
MIT