0.1.4 • Published 5 years ago

@banterstudiosuk/use-window-resize v0.1.4

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

@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

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago