"use strict";

exports.__esModule = true;
exports.useHeight = exports.default = void 0;

var _react = require("react");

var _useRect = require("./use-rect");

var useHeight = function useHeight(element) {
  var _useState = (0, _react.useState)(0),
      height = _useState[0],
      setHeight = _useState[1];

  (0, _react.useEffect)(function () {
    if (element.current) {
      setHeight((0, _useRect.getRect)(element.current).height);
    }
  }, [element.current]);
  return height;
};

exports.useHeight = useHeight;
var _default = useHeight;
exports.default = _default;