"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const React = require("react");
const VisualElementDragControls = require("./VisualElementDragControls.js");
const useConstant = require("../../utils/use-constant.js");
function useDrag(props) {
  var groupDragControls = props.dragControls, visualElement = props.visualElement;
  var dragControls = useConstant.useConstant(function() {
    return new VisualElementDragControls.VisualElementDragControls(visualElement);
  });
  React.useEffect(function() {
    return groupDragControls && groupDragControls.subscribe(dragControls);
  }, [dragControls, groupDragControls]);
  React.useEffect(function() {
    return dragControls.addListeners();
  }, [dragControls]);
}
exports.useDrag = useDrag;
//# sourceMappingURL=use-drag.js.map
