"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useWindowSize = useWindowSize;

var _react = require("react");

function useWindowSize() {
  var [windowSize, setWindowSize] = (0, _react.useState)({
    width: 0,
    height: 0
  });
  (0, _react.useEffect)(() => {
    function handleResize() {
      setWindowSize({
        width: window.innerWidth,
        height: window.innerHeight
      });
    }

    window.addEventListener('resize', handleResize);
    handleResize();
    return () => window.removeEventListener('resize', handleResize);
  }, []);
  return windowSize;
}
//# sourceMappingURL=useWindowSize.js.map