Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 319 Bytes

useWindowSize.md

File metadata and controls

21 lines (15 loc) · 319 Bytes

useWindowSize

React sensor hook that tracks dimensions of the browser window.

Usage

import {useWindowSize} from 'react-use';

const Demo = () => {
  const {width, height} = useWindowSize();

  return (
    <div>
      <div>width: {width}</div>
      <div>height: {height}</div>
    </div>
  );
};