"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _react = _interopRequireWildcard(require("react"));

var _resizeObserver = _interopRequireDefault(require("../../../lib/_util/resizeObserver"));

var ResizeObservedRow = function ResizeObservedRow(props) {
  var children = props.children,
      onResize = props.onResize,
      rowIndex = props.rowIndex;
  var handleResize = (0, _react.useCallback)(function (_width, height, target) {
    onResize(rowIndex, height, target);
  }, [onResize, rowIndex]);
  return /*#__PURE__*/_react["default"].createElement(_resizeObserver["default"], {
    resizeProp: "height",
    onResize: handleResize,
    immediately: true
  }, children);
};

ResizeObservedRow.displayName = 'ResizeObservedRow';

var _default = /*#__PURE__*/(0, _react.memo)(ResizeObservedRow);

exports["default"] = _default;
//# sourceMappingURL=ResizeObservedRow.js.map
